Rich text formatting is now available on forum.dlang.org
ag0aep6g
anonymous at example.com
Tue Apr 6 22:01:42 UTC 2021
On Friday, 2 April 2021 at 10:23:29 UTC, Vladimir Panteleev wrote:
> On Friday, 2 April 2021 at 10:12:25 UTC, ag0aep6g wrote:
[...]
>> Does the forum even support any HTML tags? If not, there's no
>> point in stripping them. But maybe that's a limitation of the
>> Markdown library you're using.
>
> The implementation does provide a knob with two settings (strip
> all HTML or allow all HTML). I don't know if it's due to a
> technical limitation of that particular implementation. I
> suspect that the reason may be something along the lines of
> that for the purposes of the formal specification, there should
> be a simple and clear rule for when sequences of characters are
> interpreted as HTML vs. when they are not, or something like
> that.
In my opinion, the proper solution would be to escape HTML before
passing the string to the Markdown processor.
So when I enter this:
<b>bold?</b> **bold!**
First turn it into this:
<b>bold?</b> **bold!**
Then pass that to the Markdown processor which turns it into this
for the browser:
<b>bold?</b> <b>bold!</b>
And newsgroup users get the original input, no "\<" or "<".
The Markdown processor won't strip any tags, because it won't see
any to begin with.
More information about the Digitalmars-d
mailing list