Module pyglet.text.formats.html

Decode HTML into attributed text.

A subset of HTML 4.01 Transitional is implemented. The following elements are supported fully:

B BLOCKQUOTE BR CENTER CODE DD DIR DL EM FONT H1 H2 H3 H4 H5 H6 I IMG KBD
LI MENU OL P PRE Q SAMP STRONG SUB SUP TT U UL VAR

The mark (bullet or number) of a list item is separated from the body of the list item with a tab, as the pyglet document model does not allow out-of-stream text. This means lists display as expected, but behave a little oddly if edited.

No CSS styling is supported.

Classes

  HTMLDecoder
Decoder for HTML documents.