Uh, that’s a bit of my fault, I tried to correct Jeff’s slightly broken code and managed to completely ruin it, was hoping I could invisibly mend it before anyone noticed but apparently not
The problem with using & to code an & is that as soon as you go to edit or quote it, it reverts back to being a plain & so you lose whatever you were trying to do, as it has done here. The easiest way to spell out an entity is to break it up with code, something like [noparse] [/noparse].
for vBulletin use HEX ‘numerical character reference’ in vBulletin and it will display.
I’m glad there’s a workaround. Is there any interest in fixing vBulletin to behave consistently in the first place?
The way it seems to work right now is:
If I type & # 9733 ; then the ampersand is not escaped, and the entity renders. -> ★
OK, I think, if ampersands aren’t escaped, then perhaps I can type & amp ; #9733 ; But no, because in this case, it seems, the ampersand is escaped. -> ★
The ideal would be if ampersands were always escaped. After all, they’re a special HTML character, just like < and >. But if for some reason that’s not possible, then it would be super nice if it were at least consistent. Either they’re always escaped or always not.
NCRs (numeric character references) and ‘character entity references’ are types of character escape used in markup. Getting back to the question NCR is the preferable choice over the entities, entities are limited to a subset of Unicode characters, NCR can specify any character and theoretically Hexadecimal has less ambiguity.
Yes, editing the post #3 made things go wonky for me. Hence why my post differs in Stevie’s QUOTE because I was still fiddling to tame the damn beast, as editing resulted in it parsing the characters differently each time.
Oops. I had the wrong terminology. I mistakenly called it a numeric entity.
NCRs (numeric character references) and ‘character entity references’ are types of character escape used in markup. Getting back to the question NCR is the preferable choice over the entities, entities are limited to a subset of Unicode characters, NCR can specify any character and theoretically Hexadecimal has less ambiguity.
On the other hand, I can remember lots of entity names, but trying to store all those NCRs in my head isn’t going to work, so from that point of view it is much easier, for those characters, to use named entities rather than have to look up the NCR every time!
Now, if you wanted to avoid having to enter certain entities you may want to save as UTF-8 so you could input the special character directly.
NCR as explained are more functional. HTML 4.01 has 252 Character entity references: http://www.w3.org/TR/html401/sgml/entities.html For X(HT)ML an application of XML, we have the XML specification that defines five “predefined entities” only: http://www.w3.org/TR/REC-xml/#sec-predefined-ent hence NCR should only be used if authoring XHTML and not using one of those 5 and HTML 4.01 only has 4 of those.
Numeric character references, both decimal and hexadecimal, can be safely used in (X)HTML and XML, but you need to be careful that you’re referencing the character’s code point from the Unicode character repertoire, not Windows-1252.