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