You can reproduce the problem with the following test code.
@Test
public void testPipeInTable() {
final String html = "<html><body>"
+ "abc|[]"
+ "<table>"
+ "<caption>[]caption</caption>"
+ "<tr><th>th|</th></tr>"
+ "<tr><td>tr|</td></tr>"
+ "<tr><td>\\</td></tr>"
+ "<tr><td>----</td></tr>"
+ "</table>"
+"</body></html>";
final MutableDataSet parseOptions = new MutableDataSet();
final String markdown = FlexmarkHtmlParser.parse(html, 20, parseOptions);
//System.out.println(html);
System.out.println(markdown);
Assert.assertTrue(markdown.contains("\\\\"));
Assert.assertTrue(markdown.contains("th\\|"));
Assert.assertTrue(markdown.contains("tr\\|"));
}
You can reproduce the problem with the following test code.