HTML comments in article source code are rendered
-
Let's say, in article submission wizard, we have some comment text in HTML (entered or pasted in "source" mode): <!-- some comment inside --> When article is submitted, it is rendered exactly as it is shown above. I understand that this is "not a bug, a feature", but rendering of comments is really hard to expect. It's pretty natural to have comments in original HTML, never rendered on the page. And I do understand that raw HTML code should be modified by the submission process:
script
and other unsafe elements needs to be eliminated, syntax coloring insidepre
, etc., but… comments… After all, this is a "source" mode. Could we have an "as is" mode which does all such modifications but leaves safe and correct HTML syntax intact? I'm reporting this issue not as a bug and not as a suggestion, just want to bring this issue to attention. Thank you.—SA
Sergey A Kryukov
-
Let's say, in article submission wizard, we have some comment text in HTML (entered or pasted in "source" mode): <!-- some comment inside --> When article is submitted, it is rendered exactly as it is shown above. I understand that this is "not a bug, a feature", but rendering of comments is really hard to expect. It's pretty natural to have comments in original HTML, never rendered on the page. And I do understand that raw HTML code should be modified by the submission process:
script
and other unsafe elements needs to be eliminated, syntax coloring insidepre
, etc., but… comments… After all, this is a "source" mode. Could we have an "as is" mode which does all such modifications but leaves safe and correct HTML syntax intact? I'm reporting this issue not as a bug and not as a suggestion, just want to bring this issue to attention. Thank you.—SA
Sergey A Kryukov
We actually spent a fair bit of energy debating whether to strip or HTML encode comments. Unfortunately, possibly because there was beer involved, I've forgotten the salient points. Maybe we just strip out comments, eh?
cheers Chris Maunder
-
We actually spent a fair bit of energy debating whether to strip or HTML encode comments. Unfortunately, possibly because there was beer involved, I've forgotten the salient points. Maybe we just strip out comments, eh?
cheers Chris Maunder
Sure, stripping them out would be much better. Keeping and not rendering them would be even better, but it's not really important, because who would want to seriously rely on them? For one thing, it's hard to imagine a crazy writer who will store a lot of information in comments if they are preserved. From the other hand, if they are not preserved, who would regret about them? As to rendering them… HTML comment rendering would be needed only for people writing on HTML, but what value can we expect from an author having problems rendering HTML comments in HTML without your help? :-) Thank you.
—SA
Sergey A Kryukov