Closed Yakiyo closed 8 months ago
After the second format is applied (underline in your case), color appends a reset [0m.
see this example:
and the corresponding raw text :
[36mword1 word2 [4mword3[0m word4 [1mword5[0m[0m
color should be reappling any other format set before the underline.
Maybe instead of applying a generic reset [0m, color should apply the specific reset for the specified format. for instance, to reset the underline [4m, color should use [24m. seems to me that the problem is in the unformat function (line 380)
I will be submitting a branch 'issue_206' to resolve this issue.
I'm trying to pretty print a markdown file. The file uses![image](https://github.com/fatih/color/assets/91675932/5b87e5e9-dd33-438a-a896-397e3bd57bfc)
{{ some-text }}
in it for indicating variables, im removing the{{
/}}
and underline the inner text, and i'm also making the entire line cyan. But it seems, cyan get's removed after the first occurrence of the underlined word. An example image:The part of the code is somewhat like this
the cyan colors stops after the first underlined word, even tho consequent words to have underlines.
In case, the full code is needed, check this