Java-Markdown-Generator icon indicating copy to clipboard operation
Java-Markdown-Generator copied to clipboard

BoldText and so on does not escape markdown special characters

Open Qworel97 opened this issue 5 years ago • 0 comments

Imaging you have code like this

new ItalicText("*italic*")

After processing you will receive

italic

The issue is that when we pass any data that can be seen as markdown string we receive strange behaviour

.replaceAll("([*_~>#-.\\[\\]()|`])", "\\\\$1")

Something like that should do that trick, but adding it by default into BoldText and others will make user depend only on styling tools provided by library, so instead it would be nice to have possibility to write something like

new IgnoreMarkdownText("*italic*")

And receive output like

\*italic\*

Thanks in advance

Qworel97 avatar Jan 20 '21 08:01 Qworel97