showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.1k stars 1.57k forks source link

Showdown escaping HTML Chars but not constantly #1004

Open CuzImBisonratte opened 3 months ago

CuzImBisonratte commented 3 months ago

In regards to #218 where the outcome was that showdown didn't escape any HTML-Special-Chars I now have the Problem that sometimes HTML-Special Chars are converted and sometimes they aren't.

Here is some Code to reproduce this:

const showdown = require("showdown")
const converter = new showdown.Converter({ simpleLineBreaks: true });

converter.makeHtml("&")
// Output is: '<p>&amp;</p>'

converter.makeHtml("*&*");
// Output is: '<p><em>&</em></p>'

As far as I know see, HTML-Special-Chars are replaced when in plain Text but not, when they are formatted somehow. Is there any way to turn this fully of or on for all text? I've searched through the config-options but didn't find any setting for this.

CuzImBisonratte commented 3 months ago

Don't know why this has been closed "by me", so reopening now