yogthos / markdown-clj

Markdown parser in Clojure
Eclipse Public License 1.0
541 stars 121 forks source link

Disable "indented code" feature? #157

Open cjohansen opened 4 years ago

cjohansen commented 4 years ago

I put some HTML in a markdown file, nad markdown-clj treated parts of it as an indented code block. This differs from the pegdown parser I switched from. E.g.:

<div class="grid-container">
  <div class="child1">
    <p>Element #1</p>
  </div>
</div>

Passing this through the parser I get <p>Element #1</p> extracted as a verbatim code sample, which is not what I wanted. Any way to work around this?

yogthos commented 4 years ago

Not at the moment, the parser isn't HTML aware, so while it will leave tags alone, it doesn't actually understand their semantics.

cjohansen commented 4 years ago

But at the very least, I would only expect four spaces indent to trigger a code block if the block is surrounded by blank lines? So in my eca, even if the parser is not html aware, the presence of text on the immediate line before which is not four space indented should prevent the creation of a code block?

yogthos commented 4 years ago

That actually looks like a bug where the parser doesn't check if the last line was empty before checking for the 4 space indent. I guess it just hasn't come up until now.