Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Advertisement

SimpleHTML widgets allow display of simple HTML markup as well as standard escape sequences. The two may be combined; if HTML is not valid (not well-formed XHTML), it will be displayed literaly.

Supported HTML

Unknown tags are ignored completely (must still be well-formed), unknown attributes for known tags are ignored gracefully. All HTML must be inside <html><body> tags to be displayed (and html and body tags must be terminated for HTML to be parsed). SimpleHTML accepts both double and single quotes for specifying parameter values, double quotes are used in examples below.

Supported tags

h1, h2, h3, p
Text containers; following optional attributes
  • align - (left, center, right) controls positioning of the text element,
img
Image, only outside of text containers; following attributes are supported:
  • align - (left, center, right) controls positioning of the image.
  • width - (number) width of image in pixels.
  • height - (number) height of image in pixels.
  • src - (string) image source, for example Interface\Icons\Ability_Ambush
a
anchor (link only), only displayed inside text containers; following attributes
  • href - (string) link to pass OnHyperLink* widget handlers
br
line break, no attributes.


Example

<html><body>
 <h1>SimpleHTML Demo: Ambush</h1>
 <img src="Interface\Icons\Ability_Ambush" width="32" height="32" align="right"/>
 <p align="center">'You think this hurts? Just wait.'</p><br/><br/>
 <p>Among every ability a rogue has at his disposal,<br/>Ambush is without a doubt the hardest hitting Rogue ability.</p>
</body></html>

Standard escape sequences

SimpleHTML also supports the usual UI Escape Sequences, which can be used to change font color, or as an alternative syntax to specify hyperlinks.

Setting element styles

It is possible to set different fonts for the text-container elements (h1, h2, h3, and p), using:

SimpleHTML:SetFont('element', font); -- SimpleHTML:SetFont('h1', GameFontHighlightLarge);

(see the SetFont documenation for more details)

You can also define font properties for these elements in your XML files, eg:

<SimpleHTML ...>
 <FontStringHeader1 inherits="GameFontHighlightLarge"/>
</SimpleHTML>
Advertisement