- attached markup-in-list.md
Markdown: incorrect extra newlines inserted when merging certain html tags
Odd testcase attached based on something I encountered.
You can see this by roundtripping the attached md file through the default markdown filter in tikal, which produces this result:
## Here's the testcase
- <a href="https://okapiframework.org">The Okapi Framework</a>
-
<Link to="https://okapiframework.org">The OkapiFramework</a>
- Another list item containing <b>inline markup</b>
Note the newline on line 4 that has been inserted before <Link>
. This is not present in the source. I initially thought this has to do with the fact that <Link>
is not in the default HTML subfilter config, so I attached a custom filter/subfilter pair that adds it. This has no effect on the outcome.
The issue seems to be because of a difference in tokenization at the flexmark/`MarkdownParser` level, where the <Link....</Link>
content is exposed to the filter as an HTML_BLOCK
token type. The equivalent <a ....</a>
content is exposed as HTML_INLINE
. I am not sure what the reason is for this, or if the bug is in flexmark vs MarkdownParser
.
Comments (4)
-
reporter -
- changed milestone to 1.43.0
-
assigned issue to
-
A related pull request #571 was opened.
-
- changed status to resolved
Pull request #571 was merged.
- Log in to comment