bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50539: Don't use comment colors in HTML textareas


From: Lars Ingebrigtsen
Subject: bug#50539: Don't use comment colors in HTML textareas
Date: Sun, 12 Sep 2021 20:55:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> Here emacs misleads the user via comment color,
> into thinking that the so-called comment is still
> a comment in an HTML textarea:
>
> $ emacs some.html
>  <form>
>   <p>
>   <textarea readonly="1">Ralph is tall.
> <!-- He's cute. -->
> </textarea>
>   </p>
>  </form>
>
> When in fact it gets rendered by browsers.

It gets rendered, but I'm not sure what the actual definition here is.

https://www.w3.org/TR/html401/interact/forms.html#h-17.7

says that the contents of <textarea> is PCDATA (parsed character data),
so for that to be rendered that way by browsers, it should be something
like:

<textarea readonly="1">Ralph is tall.
&lt;!-- He's cute. --&gt;
</textarea>

But browsers use pretty sloppy parsers, and does a lot of DWIM.

libxml2 does parse that as a textarea containing a comment.

I spent a couple minutes to say whether there's any standard that says
whether <!-- comments are allowed in PCDATA or not, but I'd assume so.
Does anybody know for sure?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]