vsch / flexmark-java

CommonMark/Markdown Java parser with source level AST. CommonMark 0.28, emulation of: pegdown, kramdown, markdown.pl, MultiMarkdown. With HTML to MD, MD to PDF, MD to DOCX conversion modules.
BSD 2-Clause "Simplified" License
2.22k stars 261 forks source link

(<pre>) preformatted text is not working when there is a blank line #499

Open sunita1112 opened 2 years ago

sunita1112 commented 2 years ago

I have this markdown content, but the parser does not considers consider content after blank line i.e # Foo003 as pre-formatted text but renders as heading.

# Test
Foo
<pre>
# Foo001
# Foo002

# Foo003
</pre>
# Foo004

We tried setting Parser.HTML_BLOCK_DEEP_PARSE_BLANK_LINE_INTERRUPTS to false, it works but again following example (not able to render list) breaks and may be other scenarios. Eg:

## The universal markup converter

Pandoc is a [Haskell](https://haskell.org) library for converting from
one markup format to another, and a command-line tool that uses this
library. It can convert *from*

<div id="input-formats">

-   `bibtex` ([BibTeX](https://ctan.org/pkg/bibtex) bibliography)
-   `biblatex` ([BibLaTeX](https://ctan.org/pkg/biblatex) bibliography)
-   `commonmark` ([CommonMark](https://commonmark.org) Markdown)

</div>

Could you suggest safer option to fix it? Thank you!

sunita1112 commented 2 years ago

Hi @vsch

We have been using flexmark in our app from quite long. And this issue was reported by one of our customer. Will you please help in this issue? Thanks