Skip to content
Snippets Groups Projects
Commit 64eafc41 authored by Robin Stocker's avatar Robin Stocker
Browse files

Use getSpecialCharacters for table extension too

parent 981d2363
No related branches found
No related tags found
No related merge requests found
...@@ -78,7 +78,7 @@ public class TablesExtension implements Parser.ParserExtension, HtmlRenderer.Htm ...@@ -78,7 +78,7 @@ public class TablesExtension implements Parser.ParserExtension, HtmlRenderer.Htm
@Override @Override
public Set<Character> getSpecialCharacters() { public Set<Character> getSpecialCharacters() {
return Collections.emptySet(); return Collections.singleton('|');
} }
}); });
} }
......
...@@ -59,6 +59,12 @@ public class TableMarkdownRendererTest { ...@@ -59,6 +59,12 @@ public class TableMarkdownRendererTest {
assertRoundTrip("|Abc|Def|\n|---|---|\n|Inline HTML|<span>Foo\\|bar</span>|\n"); assertRoundTrip("|Abc|Def|\n|---|---|\n|Inline HTML|<span>Foo\\|bar</span>|\n");
} }
@Test
public void testEscaped() {
// `|` in Text nodes needs to be escaped, otherwise the generated Markdown does not get parsed back as a table
assertRoundTrip("\\|Abc\\|\n\\|---\\|\n");
}
protected String render(String source) { protected String render(String source) {
return RENDERER.render(PARSER.parse(source)); return RENDERER.render(PARSER.parse(source));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment