-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown writer creates nested emph and strong sections #9521
Comments
Note that these nestings will work for commonmark and derivatives (gfm etc.). We could either try to make the markdown parser smarter about these nestings... If I recall correctly, the markdown parser was changed to ignore sequences of >= 4 |
Note also that the 3rd example will also cause problems for commonmark. |
I don't think that it can be solved in the reader. The markdown syntax by design can't convey nested tags, and without a new syntax the meaning of I think that the writer can simply drop the inner formatting information. It will be lossy, but only for the structure, not for what the user will see after rendering. If this is the desired approach, then the above examples should behave like this, which IMO seems reasonable: echo '<em>A<em>B</em>C</em>' | pandoc -f html -t markdown
*ABC*
# What the result is for the markdown reader:
echo '*ABC*' | pandoc -f markdown -t html
<p><em>ABC</em></p> echo '<strong><strong>A</strong></strong>' | pandoc -f html -t markdown
**A**
# What the result is for the markdown reader:
echo `**A**` | pandoc -f markdown -t html
<p><strong>A</strong></p> echo '<em><em>A</em></em>' | pandoc -f html -t markdown
*A*
# What the result is for the markdown reader:
echo `*A*` | pandoc -f markdown -t html
<p><em>A</em></p> echo '<em><em>A</em>B</em>' | pandoc -f html -t markdown
*AB*
# What the result is for the markdown reader:
echo '*AB*' | pandoc -f markdown -t html
<p><em>AB</em></p> |
Explain the problem.
The markdown writer doesn't catch nested emphasized and strong sections, leading to invalid formatting. Examples:
Ideally the formatting state should be tracked and nested formatting that doesn't introduce any additional formatting should be a no-op.
Pandoc version?
Linux
pandoc 3.1.11.1
Features: +server +lua
Scripting engine: Lua 5.4
The text was updated successfully, but these errors were encountered: