On this page
html.entities — HTML 通用实体的定义
源代码: Lib/html/entities.py
该模块定义了四个字典html5,name2codepoint,codepoint2name和entitydefs。
html.entities.html5- 字典,将 HTML5 命名字符参考[1]Map 到等效的 Unicode 字符,例如
html5['gt;'] == '>'。请注意,名称中包含了结尾的分号(例如'gt;'),但是即使没有分号,标准也接受某些名称:在这种情况下,名称中包含';'和不包含';'。另请参见html.unescape()。
- 字典,将 HTML5 命名字符参考[1]Map 到等效的 Unicode 字符,例如
版本 3.3 中的新Function。
html.entities.entitydefs- 字典,将 XHTML 1.0 实体定义 Map 到 ISO Latin-1 中的替换文本。
html.entities.name2codepoint- 将 HTML 实体名称 Map 到 Unicode 代码点的字典。
html.entities.codepoint2name- 将 Unicode 代码点 Map 到 HTML 实体名称的字典。
Footnotes