Heading - SwiftDocOrg/CommonMark GitHub Wiki
A heading.
public final class Heading: NodeFrom the CommonMark Spec:
An ATX heading consists of a string of characters, parsed as inline content, between an opening sequence of 1–6 unescaped # characters and an optional closing sequence of any number of unescaped # characters. The opening sequence of # characters must be followed by a space or by the end of line. The optional closing sequence of #s must be preceded by a space and may be followed by spaces only. The opening # character may be indented 0-3 spaces. The raw contents of the heading are stripped of leading and trailing spaces before being parsed as inline content. The heading level is equal to the number of # characters in the opening sequence.
A setext heading consists of one or more lines of text, each containing at least one non-whitespace character, with no more than 3 spaces indentation, followed by a setext heading underline. The lines of text must be such that, were they not followed by the setext heading underline, they would be interpreted as a paragraph: they cannot be interpretable as a code fence, ATX heading, block quote, thematic break, list item, or HTML block.
public convenience init(level: Int, text string: String)public convenience init(level: Int, children: [Inline & Node] = [])public convenience init(level: Int = 1, _ closure: () -> String)public convenience init(level: Int = 1, _ builder: () -> InlineConvertible)var level: Intpublic func accept<T: Visitor>(visitor: T)