Rich text formatting is now available on forum.dlang.org

Vladimir Panteleev thecybershadow.lists at gmail.com
Wed Apr 7 06:16:04 UTC 2021


On Tuesday, 6 April 2021 at 22:01:42 UTC, ag0aep6g wrote:
> In my opinion, the proper solution would be to escape HTML 
> before passing the string to the Markdown processor.

Escaping all HTML special characters, regardless of context, 
would break:

- using said characters within code blocks (inline and 
otherwise), where the Markdown processor treats them verbatim;

- using them in Markdown syntax constructs, such as block quotes 
(though arguably we only need to escape `<`) and <URL>s (which 
arguably isn't very useful as we have GitHub auto-links turned 
on).

So, this transformation would need to be as part of the Markdown 
parsing process (or otherwise replicate a subset of it, to know 
when to escape and when not to, which is bound to be fragile).

GitHub's implementation does add a few settings regarding HTML, 
but they seem to be mainly about allowing certain HTML tags 
(which we don't want to do, as HTML makes messages less readable 
in plain text).

FWIW, github.com also strips HTML tags that it does not 
recognize, and doesn't even warn you.


More information about the Digitalmars-d mailing list