SwiftyMarkdown
SwiftyMarkdown copied to clipboard
Incorrect result for string with mixed styles
Platform: iOS Version: 1.2.3 Example: "~~_**Test**_~~"
How it looks here: ~~Test~~
How it looks after SwiftyMarkdown
:
~~Test~~
NSAttributedString has next styles:
Test{
NSColor = "<UIDynamicSystemColor: 0x7b1000083180; name = labelColor>";
NSFont = "<UICTFont: 0x7b540056cc00> font-family: \"Times New Roman\"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0 LineBreakStrategy 0";
NSStrikethrough = 1;
}
I guess the problem is here.
The code replaces the previous font style. The strikethroug
is the latest what's why we always gets NSAttributedString
with NSStrikethrough
style.