MarkdownAttributedString icon indicating copy to clipboard operation
MarkdownAttributedString copied to clipboard

Underline style in `MarkdownStyleEmphasisSingle` not honored without significant change in `MarkdownStyleEmphasisDouble`

Open igz opened this issue 3 years ago • 0 comments

Setting NSUnderlineStyleAttributeName in MarkdownStyleEmphasisSingle only seems to work if MarkdownStyleEmphasisDouble is defined as well that contains a significant attributed style difference.

Use case underlining "bar" in "Foo bar".

Using SampleApp's ViewController, and enabling USE_STYLE_ATTRIBUTES, I would expect the following style attributes to work:

@{
        MarkdownStyleEmphasisSingle: @{
            NSUnderlineStyleAttributeName: @1
        }
}

However, this is insufficient to underline "bar" in the example. In order for the single emphasis style to take effect, one needs to add a MarkdownStyleEmphasisDouble definition, which has a significant difference from the base attributes (font, foregroundColor, underline style all seem to do the trick).

igz avatar Jul 12 '22 00:07 igz