html.entities — Definitions of HTML general entities

Quellcode: Lib/html/entities.py


Dieses Modul definiert vier Dictionaries: html5, name2codepoint, codepoint2name und entitydefs.

html.entities.html5

Ein Dictionary, das benannte HTML5-Zeichenreferenzen [1] auf das entsprechende Unicode-Zeichen (oder mehrere Zeichen) abbildet, z. B. html5['gt;'] == '>'. Beachte, dass das abschließende Semikolon Teil des Namens ist (z. B. 'gt;'), einige Namen jedoch auch ohne Semikolon vom Standard akzeptiert werden: In diesem Fall ist der Name sowohl mit als auch ohne ';' vorhanden. Siehe auch html.unescape().

Neu in Version 3.3.

html.entities.entitydefs

Ein Dictionary, das XHTML-1.0-Entitätsdefinitionen auf ihren Ersatztext in ISO Latin-1 abbildet.

html.entities.name2codepoint

A dictionary that maps HTML entity names to the Unicode code points.

html.entities.codepoint2name

A dictionary that maps Unicode code points to HTML entity names.

Fußnoten