flexmark-java icon indicating copy to clipboard operation
flexmark-java copied to clipboard

html2md Unexpectedly Adds Whitespace

Open eum2o opened this issue 4 years ago • 0 comments

Detected in version: 0.62.2 (flexmark-all)

Problem

If a line contains a : and <br/> the html converter unexpectedly adds a whitespace before the :. See examples below.

Example 1

Code

final String html = "<b>Foo</b>:<br/>bar";
final String md = FlexmarkHtmlConverter.builder().build().convert(html);
System.out.println(md);

Actual Output

**Foo** :  
bar

Expected Output

**Foo**:  
bar

Example 2

Code

final String html = "<b>Foo</b>: bar<br/>";
final String md = FlexmarkHtmlConverter.builder().build().convert(html);
System.out.println(md);

Actual Output

**Foo** : bar  

Expected Output

**Foo**: bar  

eum2o avatar Sep 14 '20 11:09 eum2o