Help:HTML Entity
Talk0this wiki
| This article or section is a miscellaneous stub. You can help expand it by editing it.
|
| HELP CONTENTS · Getting Started · New to WoWWIKI · Editing WoWWIKI · Editing WoWWIKI (advanced) The WoWWIKI Community · Additional Help · |
|---|
| See Wikia Help for general Wikia- and wiki- related help. See |
- See
Help:Special characters at meta.wikimedia.org for more general info about special characters in MediaWiki based wikis.
Contents |
What is an HTML Entity?
An HTML entity is a special character string that is translated by an HTML parser into a single character or symbol. All entities begin with the & (ampersand) and end with a ; (semi-colon). All fonts should support rendering of all of the ASCII range from 0 - 127 in a similar fashion (except specialty symbol fonts), but above that range the symbols used may not be reliably consistent from font to font. The use of entities is one method to try to maintain consistency of rendering character glyphs.
The basic Latin-1 character set (also known as ISO 8859-1) outside of the typical roman keyboard set has entity codes for most characters (mostly from #160 to #255) in the form of special names (usually abbreviated descriptions or acronyms). All characters including unicode can be represented by decimal versions (&dddd;) or hexadecimal versions (&xhhhh;).
Support for entities is not specific to wikis, but should be supported by all wikis, since they generally represent a translation layer from wikicode to HTML (though usually also including CSS and Javascript). This article does not apply directly to use in wikis, but is provided as a tool to use along with other wiki features.
Use of entities in WoWWiki
In general, wiki editors like to use the <nowiki> tag to temporarily turn off special properties of wiki-reserved characters like *, [, or {. However, you can also use entities to display these wiki-characters without the wiki parser trying to do something with them.
NOTE: Named entity codes are case-sensitive, hence → (→) and ⇒ (⇒) are different.
Wiki-character entities
Here are some commonly used wiki-characters and their entity codes:
| Character | Entity | Wiki usage | |
|---|---|---|---|
| # | ← | # | Numbered/ordered list |
| * | ← | * | Bulleted/unordered list |
| : | ← | : | Indent |
| ; | ← | ; | Definition (bold) |
| [ | ← | [ | Links |
| ] | ← | ] | Links |
| { | ← | { | Magic words and templates |
| | | ← | | | Magic words and templates |
| } | ← | } | Magic words and templates |
Escaping HTML characters with entities
Entities are also useful for rendering characters that might otherwise be parsed as HTML (or SGML tags specific to the wiki, like <nowiki>).
| Character | Entity | HTML usage | |
|---|---|---|---|
| < | ← | < | Tags |
| > | ← | > | Tags |
| & | ← | & | URLs and showing other entities |
| = | ← | = | Tag attributes and URLs |
| ? | ← | ? | URLs |
In a wiki, you might want to use <nowiki> to describe what <nowiki> looks like.
Common symbols used in wikis
Here are some entity codes for symbols often used in wikis:
| Character | Entity | Symbol | |
|---|---|---|---|
| • | ← | • | |
| · | ← | · | |
| ¢ | ← | ¢ | |
| € | ← | € | |
| £ | ← | £ | |
| ¥ | ← | ¥ | |
| © | ← | © | |
| ® | ← | ® | |
| ™ | ← | ™ | |
| … | ← | … | |
| † | ← | † | |
| ‡ | ← | ‡ | |
| × | ← | × | |
| ÷ | ← | ÷ | |
| ∞ | ← | ∞ | |
| ◊ | ← | ◊ | |
| ♠ | ← | ♠ | |
| ♣ | ← | ♣ | |
| ♥ | ← | ♥ | |
| ♦ | ← | ♦ |
Non-alphanumeric symbols
There are also a variety of non-alphanumeric symbols with entity codes that have a variety of uses.
| Character | Entity | HTML usage | |
|---|---|---|---|
| ← | ← | ← | Left arrow |
| → | ← | → | Right arrow |
| ↑ | ← | ↑ | Up arrow |
| ↓ | ← | ↓ | Down arrow |
| ⇐ | ← | ⇐ | Left "double" arrow |
| ⇒ | ← | ⇒ | Right "double" arrow |
| ⇑ | ← | ⇑ | Up "double" arrow |
| ⇓ | ← | ⇓ | Down "double" arrow |
Other reasons to use entities
Often people copy-paste special characters (like € or ®) from some other source, like MS Word to a wiki editor and expect everyone to see the same character glyph. Unfortunately, most computer OSes encode these characters differently in their binary form when being transferred from one place to another. So, you can't rely on everything looking as you expect when someone looks at it on a browser on a different OS (problems between MS Windows and Macintosh are notorious). Entities solve this problem by, in most cases, identifying the character symbol by a common code that HTML renderers know how to display by standard. Non-unicode entities in the 128 to 255 ASCII range that don't use named codes (like € for € or ® for ®) aren't as reliable, but most of the others will display what you expect or the generic box (☐) or question mark to indicate the glyph is not present in the font.
See also
External links
- HTML 4 Entities
- Unicode
