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

Inconsistent li output when list item contains a | inside of a code block #147

Open
zachallaun opened this issue Mar 22, 2024 · 2 comments

Comments

@zachallaun
Copy link

example = """
* `1 2`
* `3 | 4`
* `5 6`
"""

EarmarkParser.as_ast(example)
#=>
{:ok,
 [
   {"ul", [],
    [
      {"li", [], [{"code", [{"class", "inline"}], ["1 2"], %{line: 1}}], %{}},
      {"li", [],
       [
         {"p", [], [{"code", [{"class", "inline"}], ["3 | 4"], %{line: 3}}],
          %{}}
       ], %{}},
      {"li", [], [{"code", [{"class", "inline"}], ["5 6"], %{line: 3}}], %{}}
    ], %{}}
 ], []}

I noticed this while browsing the docs for Erlang's new json module here; some list items were wrapped in a <p>, while others weren't. I was able to shrink the test case down enough to find that the | was the culprit.

@RobertDober
Copy link
Owner

Thank you for this report

@RobertDober
Copy link
Owner

RobertDober commented Apr 2, 2024

Thank you again for this report, unfortunately the easy fix is not backwards compatible, as we resolve inline code later when joining lines together.

So this will need to wait for 1.5 and the peg parser I am afraid.

Keeping this open, but ETA is very uncertain.

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

No branches or pull requests

2 participants