hyperlink copy as html
@egmontkob
Submitted by Egmont Koblinger Link to original bug (#782351)
Description
Forking from the OSC 8 hyperlink bug 779734 comment 128:
One more not-so-important thing missing from the VTE patch: HTML copy-pasting.
It'll probably need a variant of thawing that either places all the hyperlinks of a row in the hyperlink pool (rather than just the one under the cursor / click location), or allocates memory elsewhere for them (memory fragmentation is not a concern here).
The code around cellattr_to_html() would probably need to be refactored as well. For attrs like bold, italic, colors etc. it's okay to close and reopen their tags at any time, it has no side effects. The hyperlink, however, shouldn't be closed and reopened when some other attribute changes as that would result in undesired behavior (multiple separate links with the same target) where you paste it.
As such, the "<a>
" tag has to be the outmost one, and kept open when other attributes change.
Instead of the current cellattr_to_html design, I'm thinking about a method that takes two VteCellAttr* parameters and is responsible for emitting the HTML tags denoting the difference, i.e. first close the ones that appear in attr1 but not in attr2, and then (in reverse order) open the ones that newly appear in attr2.
Version: git master