diff options
Diffstat (limited to 'devdocs/python~3.12/library%2Fhtml.html')
| -rw-r--r-- | devdocs/python~3.12/library%2Fhtml.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/devdocs/python~3.12/library%2Fhtml.html b/devdocs/python~3.12/library%2Fhtml.html new file mode 100644 index 00000000..e6faf9f9 --- /dev/null +++ b/devdocs/python~3.12/library%2Fhtml.html @@ -0,0 +1,15 @@ + <span id="html-hypertext-markup-language-support"></span><h1>html — HyperText Markup Language support</h1> <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.12/Lib/html/__init__.py">Lib/html/__init__.py</a></p> <p>This module defines utilities to manipulate HTML.</p> <dl class="py function"> <dt class="sig sig-object py" id="html.escape"> +<code>html.escape(s, quote=True)</code> </dt> <dd> +<p>Convert the characters <code>&</code>, <code><</code> and <code>></code> in string <em>s</em> to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. If the optional flag <em>quote</em> is true, the characters (<code>"</code>) and (<code>'</code>) are also translated; this helps for inclusion in an HTML attribute value delimited by quotes, as in <code><a href="..."></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> </dd> +</dl> <dl class="py function"> <dt class="sig sig-object py" id="html.unescape"> +<code>html.unescape(s)</code> </dt> <dd> +<p>Convert all named and numeric character references (e.g. <code>&gt;</code>, <code>&#62;</code>, <code>&#x3e;</code>) in the string <em>s</em> to the corresponding Unicode characters. This function uses the rules defined by the HTML 5 standard for both valid and invalid character references, and the <a class="reference internal" href="html.entities#html.entities.html5" title="html.entities.html5"><code>list of +HTML 5 named character references</code></a>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4.</span></p> </div> </dd> +</dl> <p>Submodules in the <code>html</code> package are:</p> <ul class="simple"> <li> +<a class="reference internal" href="html.parser#module-html.parser" title="html.parser: A simple parser that can handle HTML and XHTML."><code>html.parser</code></a> – HTML/XHTML parser with lenient parsing mode</li> <li> +<a class="reference internal" href="html.entities#module-html.entities" title="html.entities: Definitions of HTML general entities."><code>html.entities</code></a> – HTML entity definitions</li> </ul> <div class="_attribution"> + <p class="_attribution-p"> + © 2001–2023 Python Software Foundation<br>Licensed under the PSF License.<br> + <a href="https://docs.python.org/3.12/library/html.html" class="_attribution-link">https://docs.python.org/3.12/library/html.html</a> + </p> +</div> |
