Skip to content

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

@zachallaun

Description

@zachallaun
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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions