html.entities --- HTML 一般實體的定義¶
該 module(模組)定義了四個字典:html5、name2codepoint、codepoint2name 以及entitydefs。
- html.entities.html5¶
將 HTML5 命名字元引用[1] 對映到同等 Unicode 字元的字典,例如
html5['gt;']=='>'。請注意,後面的的分號包含在名稱中(例如'gt;'),但有些名稱即使沒有分號也會被此標準接受:在這種情況下,名稱可帶有或不帶有';'。請見html.unescape()。在 3.3 版被加入.
- html.entities.entitydefs¶
將 XHTML 1.0 實體定義對映到 ISO Latin-1 中的替換文字的字典。
- html.entities.name2codepoint¶
將 HTML4 實體名稱對映到 Unicode 程式點的字典。
- html.entities.codepoint2name¶
將 Unicode 程式點對映到 HTML4 實體名稱的字典。
註解
[1]請見https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references