unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>
Cc: 50539@debbugs.gnu.org
Subject: bug#50539: Don't use comment colors in HTML textareas
Date: Sun, 12 Sep 2021 20:55:28 +0200	[thread overview]
Message-ID: <87k0jlk4in.fsf@gnus.org> (raw)
In-Reply-To: <87pmtejpbm.5.fsf@jidanni.org> ("積丹尼 Dan Jacobson"'s message of "Sun, 12 Sep 2021 14:11:25 +0800")

積丹尼 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	other threads:[~2021-09-12 18:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12  6:11 bug#50539: Don't use comment colors in HTML textareas 積丹尼 Dan Jacobson
2021-09-12 18:55 ` Lars Ingebrigtsen [this message]
2021-09-12 22:05   ` Gregory Heytings
2021-09-13  8:10     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0jlk4in.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=50539@debbugs.gnu.org \
    --cc=jidanni@jidanni.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).