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.21k stars 260 forks source link

How to prevent adding trailling new lines for inline elements when using NO_P_TAGS_USE_BR #606

Open anqianqianqi opened 5 months ago

anqianqianqi commented 5 months ago

When I render with HtmlRenderer.NO_P_TAGS_USE_BR set to true, there will be 2 trailing new lines added to the element. Examples: input: **bold** output: <strong>bold</strong><br /><br />\n

However it does not happen to block level elements. Examples: input: # Headline output: <h1>Headline</h1>\n How could I remove the trailing new lines for inline elements to have it behave consistently as the block level elements?