noties / Markwon

Android markdown library (no WebView)
https://noties.io/Markwon/
Apache License 2.0
2.68k stars 298 forks source link

Extra new lines inserted in front of HTML inline code #423

Open jonnyandrew opened 1 year ago

jonnyandrew commented 1 year ago

Markwon version: 4.6.2

Extra new lines are inserted in front of inline code while parsing HTML.

I have created a minimal reproduction of this bug here: jonnyandrew/markwon-repro.

Steps to reproduce

  1. Build Markwon with the HtmlPlugin.
  2. Parse a block e.g. markwon.parse("<div>block</div>")
  3. Render this block
  4. Parse some text with inline code e.g. markwon.parse("Some <code>inline code</code>")
  5. Render this text

Expected

The rendered text does not have any extra new lines.

Actual

The rendered text has a new line immediately before the inline code.

Screenshot from the repro app

image