pragdave / earmark

Markdown parser for Elixir
Other
859 stars 135 forks source link

1.4.47 breaks table rendering #506

Closed smn closed 3 weeks ago

smn commented 3 weeks ago

Hey there,

Thanks for Earmark! We'd a big fan of the library. In the recent .47 upgrade we're noticing that the behaviour of parsing a Markdown table seems to have changed:

Here's what we're seeing for 1.4.46:

Mix.install([
  # {:earmark, "1.4.47"},
  {:earmark, "1.4.46"},
])

Section

markdown = """
foo | bar
baz | bazoo
"""

IO.puts Earmark.as_html!(markdown)
<table>
  <tbody>
    <tr>
      <td style="text-align: left;">
foo      </td>
      <td style="text-align: left;">
bar      </td>
    </tr>
    <tr>
      <td style="text-align: left;">
baz      </td>
      <td style="text-align: left;">
bazoo      </td>
    </tr>
  </tbody>
</table>
:ok

And here's what we're seeing for 1.4.47:

Mix.install([
  {:earmark, "1.4.47"},
  # {:earmark, "1.4.46"},
])

Section

markdown = """
foo | bar
baz | bazoo
"""

IO.puts Earmark.as_html!(markdown)
<p>
foo | bar
baz | bazoo</p>
:ok

I'm unable to see from the changelog whether this was intentional or not?

Thanks!

smn commented 3 weeks ago

Classic, right after posting I'm seeing that this may be due to GFM tables in Earmark Parser. Investigating that first.