Skip to content

Adding a line break before headings.. #1

@bryan1anderson

Description

@bryan1anderson
  func testHeadingLineBreak() {
        let markdown = "# Heading 1"
        let attributedString = AttributedStringFormatter.format(markdown: markdown, attributes: Self.defaultMDAttrs)
        
        XCTAssertFalse(
            attributedString.string.starts(with: "\n"),
            attributedString
                .string)
    }

I wrote a test that fails. red then green as they say.

Cannot figure out how to address this. Tried to fix this with a paragraph style.. but its inserting it a line break no matter what I do

swift markdown document:

Document
└─ Heading level: 1
   └─ Text "Heading 1"

Metadata

Metadata

Labels

verifyVerify and hopefully close

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions