Skip to content
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

ThematicBreak literal is lost in the Markdown renderer #331

Closed
jumale opened this issue Jul 1, 2024 · 1 comment · Fixed by #333
Closed

ThematicBreak literal is lost in the Markdown renderer #331

jumale opened this issue Jul 1, 2024 · 1 comment · Fixed by #333
Labels

Comments

@jumale
Copy link
Contributor

jumale commented Jul 1, 2024

Corresponding to the specification, thematic breaks can consist of 3 or more consecutive on of characters -, _ or * with 0-3 leading spaces (i.e. regex ^\s{0,3}[-_*]{3,}$).
This logic seem to be correct when reading Markdown - the thematic breaks are correctly recognised and captured as ThematicBreak node with literal parameter containing the actual value from the Markdown.
However, during rendering the literal is dropped and replaced with static ___

Expected behaviour: this markdown looks the same after parse/render

foo

   *******

bar

---

baz

Actual behaviour: rendered transforms it into

foo

___

bar

___

baz
@jumale jumale added the bug label Jul 1, 2024
@robinst
Copy link
Collaborator

robinst commented Jul 1, 2024

Yeah. MarkdownRenderer does not yet preserve everything from the input, it's main focus is on producing an equivalent document (___ is also a thematic break).

Would you want to try to make that change yourself and raise a PR? Looks like you've already found the right place where the fix should go :). I think in this case, if the node has a literal, we can use it, otherwise use ___ to not be ambiguous with lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants