Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heading style applied incorrectly? #107

Open
josephlord opened this issue Feb 26, 2021 · 0 comments
Open

Heading style applied incorrectly? #107

josephlord opened this issue Feb 26, 2021 · 0 comments

Comments

@josephlord
Copy link

A second line with space character turns the first line into a heading. The first example here is fine but the second with the space between the newlines causes 28 point font to be applied to the first line.

It is possible that this is correct behaviour and is just an aspect of Markdown that I wasn't aware of. My expectation was not of a styling change between the two strings ("Boom\n\nBang" and "Boom\n \nBang")

(lldb) po renderer.attributedString(from: "Boom\n\nBang")
Boom{
    NSColor = "<UIDynamicSystemColor: 0x600000dcb040; name = labelColor>";
    NSFont = "<UICTFont: 0x7fc4910182b0> font-family: \"UICTFontTextStyleBody\"; 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";
}

{
}Bang{
    NSColor = "<UIDynamicSystemColor: 0x600000dcb040; name = labelColor>";
    NSFont = "<UICTFont: 0x7fc4910182b0> font-family: \"UICTFontTextStyleBody\"; 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";
}

(lldb) po renderer.attributedString(from: "Boom\n \nBang")
Boom{
    NSColor = "<UIDynamicSystemColor: 0x600000dcb040; name = labelColor>";
    NSFont = "<UICTFont: 0x7fc4874f9d30> font-family: \"UICTFontTextStyleTitle1\"; font-weight: normal; font-style: normal; font-size: 28.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";
}
{
}Bang{
    NSColor = "<UIDynamicSystemColor: 0x600000dcb040; name = labelColor>";
    NSFont = "<UICTFont: 0x7fc4910182b0> font-family: \"UICTFontTextStyleBody\"; 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";
}

I might be able to look into fixing this but would prefer confirmation that it is regarded as a bug before I spend time on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant