ElkArte Community

Elk Development => Bug Reports => Topic started by: JPalmer on September 17, 2020, 11:06:01 am

Title: Notification email shows "bad" html
Post by: JPalmer on September 17, 2020, 11:06:01 am
The forum allows users to subscribe to email notifications, so that they get a message when a new topic or reply is posted.

I found a bug when the text contains characters that result in HTML entities.

Example:

Code: [Select]
[color=blue]> - greater than (>)[/color]


fails to render correctly, i.e. the text in the resulting email shows ">" instead of ">".

Without the color attribute it renders correctly:

Code: [Select]
> - greater than (>)

This makes me believe the BBCode rendering to HTML is incomplete to say the least. Anything I could do about this?
Title: Re: Notification email shows "bad" html
Post by: emanuele on September 27, 2020, 12:44:19 pm
hmm...
The issue could "simply" be that the greater sign is firstly converted to > when the bbcode is interpreted, and then the & is encoded too into & when converted to HTML.
Here probably @Spuds would have more knowledge than me of the internals of these conversions...
Title: Re: Notification email shows "bad" html
Post by: Spuds on September 27, 2020, 08:29:02 pm
Well the BBC to HTML should be part of the core, its the BBC parser AFAIK.

Seems like the HTML to MD which is what the Email is sent out as (give or take) may need to convert any danging &gt and associated cruf to plain text.   TBH I have not looked at the code in quite some time :(
Title: Re: Notification email shows "bad" html
Post by: emanuele on September 28, 2020, 07:42:05 am
Hey Spuds!
How is it?

At least you have looked at it more than me! xD