-
Notifications
You must be signed in to change notification settings - Fork 2
Thematic breaks don't interrupt paragraphs #41
Description
GFM Spec Reference
Per the GFM spec (§4.1 Thematic breaks):
Thematic breaks can interrupt a paragraph:
Example 28 from spec:
Foo
***
barExpected HTML:
<p>Foo</p>
<hr />
<p>bar</p>Reproduction
Stars, underscores, and spaced variants all fail to interrupt a paragraph:
Foo
***
bar
Foo
___
bar
Foo
* * *
barNote: --- works because it's treated as a setext heading underline, not because thematic break interruption is implemented.
Actual Output
The *** is treated as inline emphasis markup (* italic containing empty string, then literal *), and the whole thing becomes one paragraph. Similarly ___ is treated as underscore emphasis, and * * * as alternating italic markers.
Root Cause
handle_in_paragraph() does not check for thematic breaks. It only checks for: blank lines, setext heading underlines, fenced code blocks, and table delimiter rows. The is_horizontal_rule() check only happens in handle_ready_state().
This is the same class of bug as #39 (code fences not interrupting paragraphs).