Skip to content

Pipe characters are not escaped in Table (FlexmarkHtmlParser) #268

@yososs

Description

@yososs

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\\|"));
	}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions