metalsmith / markdown

A metalsmith plugin to render markdown files to HTML.
MIT License
63 stars 65 forks source link

Markdown in nested HTML #35

Closed zslabs closed 5 years ago

zslabs commented 5 years ago

👋Using 0.2.2 I was able to write code blocks inside of tables like this:

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>`framework.alert.beforecollapse`</td>
      <td>Before alert collapse</td>
    </tr>
    <tr>
      <td>`framework.alert.collapse`</td>
      <td>On alert collapse</td>
    </tr>
    <tr>
      <td>`framework.alert.beforereveal`</td>
      <td>Before alert reveal</td>
    </tr>
    <tr>
      <td>`framework.alert.reveal`</td>
      <td>On alert reveal</td>
    </tr>
  </tbody>
</table>

but now it looks like the markdown is being escaped. I've heard that markdown="1" on HTML elements in certain frameworks like kramdown can preserve this functionality; but just wanted to know if that was intended behavior of the new version. Thanks!

zslabs commented 5 years ago

It looks like this should be supported with markdown="1" but the above example isn't working with the latest metalsmith-markdown.

woodyrew commented 5 years ago

This is a change in Marked to comply with CommonMark as far as I can tell. Demo Example

It's intended behaviour of using Marked. I expect it wouldn't be too difficult to fork and use Kramed (Kramdown) however the project looks like it's out of maintenance.