I was working on making marked.js to comply with commonmark as much as possible when I ran into the following thing. Example 60 tells us:
Since indicators of block structure take precedence over indicators of inline structure, the following are setext headings:
<a title="a lot --- of dashes"/>
My implementation parses this as a whole HTML block of type (7) (open tag), and I can’t find a reason why it shouldn’t.
- Start condition: line begins with a complete open tag or closing tag (with any tag name other than script, style, or pre) followed only by whitespace or the end of the line.
End condition: line is followed by a blank line.
It does not say that the tag must be on a single line, maybe I’ve missed something.
An open tag consists of a < character, a tag name, zero or more attributes, optional whitespace, an optional / character, and a > character.
If the open tag must lay on a single line, should I create a “special” attribute parsing rule that does not allow newlines?