tea.mathoverflow.net - Discussion Feed (HTML entities in comments) Sun, 04 Nov 2018 13:07:47 -0800 http://mathoverflow.tqft.net/ Lussumo Vanilla 1.1.9 & Feed Publisher Andrew Stacey comments on "HTML entities in comments" (11932) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11932#Comment_11932 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11932#Comment_11932 Thu, 16 Dec 2010 00:07:08 -0800 Andrew Stacey In reply to Scott's post:

If anyone want to point me to a good discussion of this, or explain that there is in fact a canonical resolution of this problem, I'd love to hear.

Maybe I've just gotten so used to the Markdown way of doing this that I can't see its drawbacks, but it does seem to work fine and I don't tend to get caught out by this. The rule is quite simple: if it looks like an entity, it is an entity. If it doesn't look like an entity, it isn't. Thus if I write α then Markdown correctly lets that through to produce α, but if I write & or &hello or & ; then Markdown correctly escapes the ampersand to produce &hello and & ;.

The real problem with HTML entities in comments is that it is different to what happens in answers, thus violating the "Principle of Least Surprise".

]]>
Scott Morrison comments on "HTML entities in comments" (11915) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11915#Comment_11915 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11915#Comment_11915 Wed, 15 Dec 2010 13:00:24 -0800 Scott Morrison Doh! :-)

]]>
Anton Geraschenko comments on "HTML entities in comments" (11913) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11913#Comment_11913 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11913#Comment_11913 Wed, 15 Dec 2010 10:34:54 -0800 Anton Geraschenko

@Scott: You probably meant to say “without having to write &”.

That's what he wrote, but this forum converted it to an &. He should have written & or `&`. :-)

]]>
Mike Shulman comments on "HTML entities in comments" (11912) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11912#Comment_11912 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11912#Comment_11912 Wed, 15 Dec 2010 09:40:29 -0800 Mike Shulman @Scott: That sounds reasonable, but why does it work fine in questions and answers, but not in comments?

]]>
Harald Hanche-Olsen comments on "HTML entities in comments" (11911) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11911#Comment_11911 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11911#Comment_11911 Wed, 15 Dec 2010 09:03:17 -0800 Harald Hanche-Olsen @Scott: You probably meant to say “without having to write &”.

]]>
Scott Morrison comments on "HTML entities in comments" (11910) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11910#Comment_11910 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11910#Comment_11910 Wed, 15 Dec 2010 08:04:33 -0800 Scott Morrison @Mike, it's probably not a desired behavior. It's worth remembering that handling HTML entities in user entered text is complicated, and I don't think there's a canonical way to do it. The problem, of course, is that humans want to type ampersands in their plain text (and in the LaTeX!) without having to write &. In proper HTML string, bare ampersands like this would never appear.

Thus if you're rendering a chunk of human entered text, you need to come up with some rule for deciding which ampersands are "literal" and which are the beginnings of HTML entities.

If anyone want to point me to a good discussion of this, or explain that there is in fact a canonical resolution of this problem, I'd love to hear.

]]>
WillieWong comments on "HTML entities in comments" (11909) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11909#Comment_11909 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11909#Comment_11909 Wed, 15 Dec 2010 06:01:55 -0800 WillieWong @Andrew: ooh... shiny!

]]>
Andrew Stacey comments on "HTML entities in comments" (11907) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11907#Comment_11907 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11907#Comment_11907 Wed, 15 Dec 2010 02:07:53 -0800 Andrew Stacey Don't forget about my little script which converts LaTeX code to HTML entities:

http://www.math.ntnu.no/~stacey/code/latexToUTF/utf.php

]]>
Harald Hanche-Olsen comments on "HTML entities in comments" (11906) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11906#Comment_11906 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11906#Comment_11906 Wed, 15 Dec 2010 00:28:16 -0800 Harald Hanche-Olsen It might be worth your time learning how to type the needed characters directly. I expect this will become more and more useful as Unicode slowly gains a more solid foot hold in the world.

]]>
Mike Shulman comments on "HTML entities in comments" (11905) http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11905#Comment_11905 http://mathoverflow.tqft.net/discussion/841/html-entities-in-comments/?Focus=11905#Comment_11905 Tue, 14 Dec 2010 19:42:19 -0800 Mike Shulman When writing a question or answer, I often try to use HTML entities when possible instead of mathjax, since they don't take time to render. But this doesn't seem to work when writing a comment; in that case HTML entities get escaped and thus don't show the way I want. Is that a known and desired feature?

]]>