Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  

    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?

  2.  

    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.

  3.  

    Don't forget about my little script which converts LaTeX code to HTML entities:

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

    • CommentAuthorWillieWong
    • CommentTimeDec 15th 2010
     

    @Andrew: ooh... shiny!

  4.  

    @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.

  5.  

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

  6.  

    @Scott: That sounds reasonable, but why does it work fine in questions and answers, but not in comments?

  7.  

    @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 `&`. :-)

  8.  

    Doh! :-)

  9.  

    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".