Using <a>
to support nested text-decoration
#75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Builds on #57 .
I have switched here to using
<a>
instead of<span>
.The reason is that span will not allow overriding
text-decoration
styles (I had some underlining which wasn't getting disabled for this reason). (The same problem occurs in ansi-to-html's current state.)I would have thought divs would work, but when using
<div style="display: inline;">
, though the Inspector (in Firefox or Chrome) shows the nested values as applying (e.g., atext-decoration: none
), it still shows the content with an underline. This issue appears specific totext-decoration
; the following can offer some more detail: https://stackoverflow.com/questions/1823341/how-do-i-get-this-css-text-decoration-override-to-workBut things work fine in both Firefox and Chrome when I change the elements to an
<a>
instead (withouthref
). One problem is that the browser source shows this as invalid, I guess for having both flow and phrasing content, but I still think this may be the best solution.You expressed concerns about this in #57 , but I think this is the only way to truly work with
text-decoration
overrides (as needed when overriding underline, strike-through, and overline). If you want this behind a flag, let me know.(While I may be able to go back to using spans for the colors, I'm not sure if there are any cases where resetting a color should also reset the text-decoration. And I haven't added any tests for resetting command 0 to see its effect with text-decoration.)