Skip to content

Faulty parsing of ** in strong code block #144

@garazdawi

Description

@garazdawi

I was doing some markdown of inline C code and noticed that the parser interprets ** inside ` as the end of the emphasis.

iex(1)> EarmarkParser.as_ast "**`**`**"
{:ok, [{"p", [], [{"strong", [], ["`"], %{}}, "`**"], %{}}], []}

There is a simple workaround by using __ instead as the emphasis marker. i.e.

iex(2)> EarmarkParser.as_ast "__`**`__"
{:ok,
 [
   {"p", [],
    [{"strong", [], [{"code", [{"class", "inline"}], ["**"], %{line: 1}}], %{}}],
    %{}}
 ], []}

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions