uTools-Manuals/docs/python/html.entities.html
2019-04-08 23:22:26 +08:00

1 line
4.2 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="body" role="main"><div class="section" id="module-html.entities"><h1><span class="yiyi-st" id="yiyi-10">20.3. <a class="reference internal" href="#module-html.entities" title="html.entities: Definitions of HTML general entities."><code class="xref py py-mod docutils literal"><span class="pre">html.entities</span></code></a> - HTML一般实体的定义</span></h1><p><span class="yiyi-st" id="yiyi-11"><strong>源代码:</strong> <a class="reference external" href="https://hg.python.org/cpython/file/3.5/Lib/html/entities.py">Lib / html / entities.py</a></span></p><p><span class="yiyi-st" id="yiyi-12">此模块定义了四个字典,<a class="reference internal" href="#html.entities.html5" title="html.entities.html5"><code class="xref py py-data docutils literal"><span class="pre">html5</span></code></a><a class="reference internal" href="#html.entities.name2codepoint" title="html.entities.name2codepoint"><code class="xref py py-data docutils literal"><span class="pre">name2codepoint</span></code></a><a class="reference internal" href="#html.entities.codepoint2name" title="html.entities.codepoint2name"><code class="xref py py-data docutils literal"><span class="pre">codepoint2name</span></code></a><a class="reference internal" href="#html.entities.entitydefs" title="html.entities.entitydefs"><code class="xref py py-data docutils literal"><span class="pre">entitydefs</span></code></a></span></p><dl class="data"><dt id="html.entities.html5"><span class="yiyi-st" id="yiyi-13"> <code class="descclassname">html.entities.</code><code class="descname">html5</code></span></dt><dd><p><span class="yiyi-st" id="yiyi-14">将HTML5命名字符引用<a class="footnote-reference" href="#id2" id="id1">[1]</a>射到等效的Unicode字符的字典例如</span><span class="yiyi-st" id="yiyi-15"><code class="docutils literal"><span class="pre">html5 ['gt']</span> <span class="pre">==</span> <span class="pre">'&gt;gt'</span></code></span><span class="yiyi-st" id="yiyi-16">注意,尾部分号包括在名称中(例如,</span><span class="yiyi-st" id="yiyi-17"><code class="docutils literal"><span class="pre">'gt;'</span></code>),但是有些名称在没有分号的情况下也被标准接受:在这种情况下,名称存在与没有<code class="docutils literal"><span class="pre">';'</span></code></span><span class="yiyi-st" id="yiyi-18">另请参见<a class="reference internal" href="html.html#html.unescape" title="html.unescape"><code class="xref py py-func docutils literal"><span class="pre">html.unescape()</span></code></a></span></p><div class="versionadded"><p><span class="yiyi-st" id="yiyi-19"><span class="versionmodified">版本3.3中的新功能。</span></span></p></div></dd></dl><dl class="data"><dt id="html.entities.entitydefs"><span class="yiyi-st" id="yiyi-20"> <code class="descclassname">html.entities.</code><code class="descname">entitydefs</code></span></dt><dd><p><span class="yiyi-st" id="yiyi-21">将XHTML 1.0实体定义映射到ISO Latin-1中的替换文本的字典。</span></p></dd></dl><dl class="data"><dt id="html.entities.name2codepoint"><span class="yiyi-st" id="yiyi-22"> <code class="descclassname">html.entities.</code><code class="descname">name2codepoint</code></span></dt><dd><p><span class="yiyi-st" id="yiyi-23">将HTML实体名称映射到Unicode代码点的字典。</span></p></dd></dl><dl class="data"><dt id="html.entities.codepoint2name"><span class="yiyi-st" id="yiyi-24"> <code class="descclassname">html.entities.</code><code class="descname">codepoint2name</code></span></dt><dd><p><span class="yiyi-st" id="yiyi-25">将Unicode代码点映射到HTML实体名称的字典。</span></p></dd></dl><p class="rubric"><span class="yiyi-st" id="yiyi-26">脚注</span></p><table class="docutils footnote" frame="void" id="id2" rules="none"><tbody valign="top"><tr><td class="label"><span class="yiyi-st" id="yiyi-27"><a class="fn-backref" href="#id1">[1]</a></span></td><td><span class="yiyi-st" id="yiyi-28">请参阅<a class="reference external" href="https://www.w3.org/TR/html5/syntax.html#named-character-references">https://www.w3.org/TR/html5/syntax.html#named-character-references</a></span></td></tr></tbody></table></div></div>