Files
Nim/htmlparser.html
github-actions[bot] ef3d9e7b38 Deploy to GitHub pages
2025-12-28 15:55:52 +00:00

652 lines
82 KiB
HTML

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>src/htmlparser</title>
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
<!-- JS -->
<script type="text/javascript" src="dochack.js?v=2.3.1"></script>
</head>
<body>
<div class="document" id="documentId">
<div class="container">
<h1 class="title">src/htmlparser</h1>
<div class="row">
<div class="three columns">
<div class="theme-select-wrapper">
<label for="theme-select">Theme:&nbsp;</label>
<select id="theme-select" onchange="setTheme(this.value)">
<option value="auto">🌗 Match OS</option>
<option value="dark">🌑 Dark</option>
<option value="light">🌕 Light</option>
</select>
</div>
<div id="global-links">
<ul class="simple-boot">
<li><a href="manual.html">Manual</a></li>
<li><a href="lib.html">Standard library</a></li>
<li> <a id="indexLink" href="theindex.html">Index</a></li>
<li><a href="compiler/theindex.html">Compiler docs</a></li>
<li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
<li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="search" id="searchInput"
oninput="search()" />
</div>
<ul class="simple simple-toc" id="toc-list">
<li><a class="reference" id="examplecolon-transforming-hyperlinks_toc" href="#examplecolon-transforming-hyperlinks">Example: Transforming hyperlinks</a></li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#HtmlTag" title="HtmlTag = enum
tagUnknown, ## unknown HTML element
tagA, ## the HTML `a` element
tagAbbr, ## the deprecated HTML `abbr` element
tagAcronym, ## the HTML `acronym` element
tagAddress, ## the HTML `address` element
tagApplet, ## the deprecated HTML `applet` element
tagArea, ## the HTML `area` element
tagArticle, ## the HTML `article` element
tagAside, ## the HTML `aside` element
tagAudio, ## the HTML `audio` element
tagB, ## the HTML `b` element
tagBase, ## the HTML `base` element
tagBdi, ## the HTML `bdi` element
tagBdo, ## the deprecated HTML `dbo` element
tagBasefont, ## the deprecated HTML `basefont` element
tagBig, ## the HTML `big` element
tagBlockquote, ## the HTML `blockquote` element
tagBody, ## the HTML `body` element
tagBr, ## the HTML `br` element
tagButton, ## the HTML `button` element
tagCanvas, ## the HTML `canvas` element
tagCaption, ## the HTML `caption` element
tagCenter, ## the deprecated HTML `center` element
tagCite, ## the HTML `cite` element
tagCode, ## the HTML `code` element
tagCol, ## the HTML `col` element
tagColgroup, ## the HTML `colgroup` element
tagCommand, ## the HTML `command` element
tagDatalist, ## the HTML `datalist` element
tagDd, ## the HTML `dd` element
tagDel, ## the HTML `del` element
tagDetails, ## the HTML `details` element
tagDfn, ## the HTML `dfn` element
tagDialog, ## the HTML `dialog` element
tagDiv, ## the HTML `div` element
tagDir, ## the deprecated HTLM `dir` element
tagDl, ## the HTML `dl` element
tagDt, ## the HTML `dt` element
tagEm, ## the HTML `em` element
tagEmbed, ## the HTML `embed` element
tagFieldset, ## the HTML `fieldset` element
tagFigcaption, ## the HTML `figcaption` element
tagFigure, ## the HTML `figure` element
tagFont, ## the deprecated HTML `font` element
tagFooter, ## the HTML `footer` element
tagForm, ## the HTML `form` element
tagFrame, ## the HTML `frame` element
tagFrameset, ## the deprecated HTML `frameset` element
tagH1, ## the HTML `h1` element
tagH2, ## the HTML `h2` element
tagH3, ## the HTML `h3` element
tagH4, ## the HTML `h4` element
tagH5, ## the HTML `h5` element
tagH6, ## the HTML `h6` element
tagHead, ## the HTML `head` element
tagHeader, ## the HTML `header` element
tagHgroup, ## the HTML `hgroup` element
tagHtml, ## the HTML `html` element
tagHr, ## the HTML `hr` element
tagI, ## the HTML `i` element
tagIframe, ## the deprecated HTML `iframe` element
tagImg, ## the HTML `img` element
tagInput, ## the HTML `input` element
tagIns, ## the HTML `ins` element
tagIsindex, ## the deprecated HTML `isindex` element
tagKbd, ## the HTML `kbd` element
tagKeygen, ## the HTML `keygen` element
tagLabel, ## the HTML `label` element
tagLegend, ## the HTML `legend` element
tagLi, ## the HTML `li` element
tagLink, ## the HTML `link` element
tagMap, ## the HTML `map` element
tagMark, ## the HTML `mark` element
tagMenu, ## the deprecated HTML `menu` element
tagMeta, ## the HTML `meta` element
tagMeter, ## the HTML `meter` element
tagNav, ## the HTML `nav` element
tagNobr, ## the deprecated HTML `nobr` element
tagNoframes, ## the deprecated HTML `noframes` element
tagNoscript, ## the HTML `noscript` element
tagObject, ## the HTML `object` element
tagOl, ## the HTML `ol` element
tagOptgroup, ## the HTML `optgroup` element
tagOption, ## the HTML `option` element
tagOutput, ## the HTML `output` element
tagP, ## the HTML `p` element
tagParam, ## the HTML `param` element
tagPre, ## the HTML `pre` element
tagProgress, ## the HTML `progress` element
tagQ, ## the HTML `q` element
tagRp, ## the HTML `rp` element
tagRt, ## the HTML `rt` element
tagRuby, ## the HTML `ruby` element
tagS, ## the deprecated HTML `s` element
tagSamp, ## the HTML `samp` element
tagScript, ## the HTML `script` element
tagSection, ## the HTML `section` element
tagSelect, ## the HTML `select` element
tagSmall, ## the HTML `small` element
tagSource, ## the HTML `source` element
tagSpan, ## the HTML `span` element
tagStrike, ## the deprecated HTML `strike` element
tagStrong, ## the HTML `strong` element
tagStyle, ## the HTML `style` element
tagSub, ## the HTML `sub` element
tagSummary, ## the HTML `summary` element
tagSup, ## the HTML `sup` element
tagTable, ## the HTML `table` element
tagTbody, ## the HTML `tbody` element
tagTd, ## the HTML `td` element
tagTextarea, ## the HTML `textarea` element
tagTfoot, ## the HTML `tfoot` element
tagTh, ## the HTML `th` element
tagThead, ## the HTML `thead` element
tagTime, ## the HTML `time` element
tagTitle, ## the HTML `title` element
tagTr, ## the HTML `tr` element
tagTrack, ## the HTML `track` element
tagTt, ## the HTML `tt` element
tagU, ## the deprecated HTML `u` element
tagUl, ## the HTML `ul` element
tagVar, ## the HTML `var` element
tagVideo, ## the HTML `video` element
tagWbr ## the HTML `wbr` element">HtmlTag</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#10" id="60">Consts</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#BlockTags" title="BlockTags = {tagAddress, tagBlockquote, tagCenter, tagDel, tagDir, tagDiv,
tagDl, tagFieldset, tagForm, tagH1, tagH2, tagH3, tagH4, tagH5,
tagH6, tagHr, tagIns, tagIsindex, tagMenu, tagNoframes,
tagNoscript, tagOl, tagP, tagPre, tagTable, tagUl, tagCenter,
tagDir, tagIsindex, tagMenu, tagNoframes}">BlockTags</a></li>
<li><a class="reference" href="#InlineTags" title="InlineTags = {tagA, tagAbbr, tagAcronym, tagApplet, tagB, tagBasefont, tagBdo,
tagBig, tagBr, tagButton, tagCite, tagCode, tagDel, tagDfn, tagEm,
tagFont, tagI, tagImg, tagIns, tagInput, tagIframe, tagKbd,
tagLabel, tagMap, tagObject, tagQ, tagSamp, tagScript, tagSelect,
tagSmall, tagSpan, tagStrong, tagSub, tagSup, tagTextarea, tagTt,
tagVar, tagApplet, tagBasefont, tagFont, tagIframe, tagU, tagS,
tagStrike, tagWbr}">InlineTags</a></li>
<li><a class="reference" href="#SingleTags" title="SingleTags = {tagArea, tagBase, tagBasefont, tagBr, tagCol, tagFrame, tagHr,
tagImg, tagIsindex, tagLink, tagMeta, tagParam, tagWbr, tagSource}">SingleTags</a></li>
<li><a class="reference" href="#tagToStr" title="tagToStr = [&quot;a&quot;, &quot;abbr&quot;, &quot;acronym&quot;, &quot;address&quot;, &quot;applet&quot;, &quot;area&quot;, &quot;article&quot;,
&quot;aside&quot;, &quot;audio&quot;, &quot;b&quot;, &quot;base&quot;, &quot;basefont&quot;, &quot;bdi&quot;, &quot;bdo&quot;, &quot;big&quot;,
&quot;blockquote&quot;, &quot;body&quot;, &quot;br&quot;, &quot;button&quot;, &quot;canvas&quot;, &quot;caption&quot;, &quot;center&quot;,
&quot;cite&quot;, &quot;code&quot;, &quot;col&quot;, &quot;colgroup&quot;, &quot;command&quot;, &quot;datalist&quot;, &quot;dd&quot;,
&quot;del&quot;, &quot;details&quot;, &quot;dfn&quot;, &quot;dialog&quot;, &quot;div&quot;, &quot;dir&quot;, &quot;dl&quot;, &quot;dt&quot;, &quot;em&quot;,
&quot;embed&quot;, &quot;fieldset&quot;, &quot;figcaption&quot;, &quot;figure&quot;, &quot;font&quot;, &quot;footer&quot;,
&quot;form&quot;, &quot;frame&quot;, &quot;frameset&quot;, &quot;h1&quot;, &quot;h2&quot;, &quot;h3&quot;, &quot;h4&quot;, &quot;h5&quot;, &quot;h6&quot;,
&quot;head&quot;, &quot;header&quot;, &quot;hgroup&quot;, &quot;html&quot;, &quot;hr&quot;, &quot;i&quot;, &quot;iframe&quot;, &quot;img&quot;,
&quot;input&quot;, &quot;ins&quot;, &quot;isindex&quot;, &quot;kbd&quot;, &quot;keygen&quot;, &quot;label&quot;, &quot;legend&quot;, &quot;li&quot;,
&quot;link&quot;, &quot;map&quot;, &quot;mark&quot;, &quot;menu&quot;, &quot;meta&quot;, &quot;meter&quot;, &quot;nav&quot;, &quot;nobr&quot;,
&quot;noframes&quot;, &quot;noscript&quot;, &quot;object&quot;, &quot;ol&quot;, &quot;optgroup&quot;, &quot;option&quot;,
&quot;output&quot;, &quot;p&quot;, &quot;param&quot;, &quot;pre&quot;, &quot;progress&quot;, &quot;q&quot;, &quot;rp&quot;, &quot;rt&quot;, &quot;ruby&quot;,
&quot;s&quot;, &quot;samp&quot;, &quot;script&quot;, &quot;section&quot;, &quot;select&quot;, &quot;small&quot;, &quot;source&quot;,
&quot;span&quot;, &quot;strike&quot;, &quot;strong&quot;, &quot;style&quot;, &quot;sub&quot;, &quot;summary&quot;, &quot;sup&quot;,
&quot;table&quot;, &quot;tbody&quot;, &quot;td&quot;, &quot;textarea&quot;, &quot;tfoot&quot;, &quot;th&quot;, &quot;thead&quot;, &quot;time&quot;,
&quot;title&quot;, &quot;tr&quot;, &quot;track&quot;, &quot;tt&quot;, &quot;u&quot;, &quot;ul&quot;, &quot;var&quot;, &quot;video&quot;, &quot;wbr&quot;]">tagToStr</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">entityToRune
<li><a class="reference" href="#entityToRune%2Cstring" title="entityToRune(entity: string): Rune">entityToRune(entity: string): Rune</a></li>
</ul>
<ul class="simple nested-toc-section">entityToUtf8
<li><a class="reference" href="#entityToUtf8%2Cstring" title="entityToUtf8(entity: string): string">entityToUtf8(entity: string): string</a></li>
</ul>
<ul class="simple nested-toc-section">htmlTag
<li><a class="reference" href="#htmlTag%2CXmlNode" title="htmlTag(n: XmlNode): HtmlTag">htmlTag(n: XmlNode): HtmlTag</a></li>
<li><a class="reference" href="#htmlTag%2Cstring" title="htmlTag(s: string): HtmlTag">htmlTag(s: string): HtmlTag</a></li>
</ul>
<ul class="simple nested-toc-section">loadHtml
<li><a class="reference" href="#loadHtml%2Cstring" title="loadHtml(path: string): XmlNode">loadHtml(path: string): XmlNode</a></li>
<li><a class="reference" href="#loadHtml%2Cstring%2Cseq%5Bstring%5D" title="loadHtml(path: string; errors: var seq[string]): XmlNode">loadHtml(path: string; errors: var seq[string]): XmlNode</a></li>
</ul>
<ul class="simple nested-toc-section">parseHtml
<li><a class="reference" href="#parseHtml%2Cstring" title="parseHtml(html: string): XmlNode">parseHtml(html: string): XmlNode</a></li>
<li><a class="reference" href="#parseHtml%2CStream" title="parseHtml(s: Stream): XmlNode">parseHtml(s: Stream): XmlNode</a></li>
<li><a class="reference" href="#parseHtml%2CStream%2Cstring%2Cseq%5Bstring%5D" title="parseHtml(s: Stream; filename: string; errors: var seq[string]): XmlNode">parseHtml(s: Stream; filename: string; errors: var seq[string]): XmlNode</a></li>
</ul>
<ul class="simple nested-toc-section">runeToEntity
<li><a class="reference" href="#runeToEntity%2CRune" title="runeToEntity(rune: Rune): string">runeToEntity(rune: Rune): string</a></li>
</ul>
</ul>
</details>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<div id="tocRoot"></div>
<p class="module-desc"><div class="admonition admonition-info"><span class="admonition-info-text"><b>Note:</b></span>
In order to use this module, run <tt class="docutils literal"><span class="pre"><span class="Identifier">nimble</span> <span class="Identifier">install</span> <span class="Identifier">htmlparser</span></span></tt>.</div>
<p><strong>NOTE</strong>: The behaviour might change in future versions as it is not clear what &quot;<em>wild</em> HTML the real world uses&quot; really implies.</p>
<p>It can be used to parse a wild HTML document and output it as valid XHTML document (well, if you are lucky):</p>
<p><pre class="listing"><span class="Identifier">echo</span> <span class="Identifier">loadHtml</span><span class="Punctuation">(</span><span class="StringLit">&quot;mydirty.html&quot;</span><span class="Punctuation">)</span></pre></p>
<p>Every tag in the resulting tree is in lower case.</p>
<p><strong>Note:</strong> The resulting <tt class="docutils literal"><span class="pre"><span class="Identifier">XmlNode</span></span></tt> already uses the <tt class="docutils literal"><span class="pre"><span class="Identifier">clientData</span></span></tt> field, so it cannot be used by clients of this library.</p>
<h1><a class="toc-backref" id="examplecolon-transforming-hyperlinks" href="#examplecolon-transforming-hyperlinks">Example: Transforming hyperlinks</a></h1><p>This code demonstrates how you can iterate over all the tags in an HTML file and write back the modified version. In this case we look for hyperlinks ending with the extension <tt class="docutils literal"><span class="pre"><span class="Operator">.</span><span class="Identifier">rst</span></span></tt> and convert them to <tt class="docutils literal"><span class="pre"><span class="Operator">.</span><span class="Identifier">html</span></span></tt>.</p>
<p><pre class="listing"><span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Identifier">xmltree</span> <span class="Comment"># To use '$' for XmlNode</span>
<span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Identifier">strtabs</span> <span class="Comment"># To access XmlAttributes</span>
<span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Identifier">os</span> <span class="Comment"># To use splitFile</span>
<span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Identifier">strutils</span> <span class="Comment"># To use cmpIgnoreCase</span>
<span class="Keyword">proc</span> <span class="Identifier">transformHyperlinks</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Operator">=</span>
<span class="Keyword">let</span> <span class="Identifier">html</span> <span class="Operator">=</span> <span class="Identifier">loadHtml</span><span class="Punctuation">(</span><span class="StringLit">&quot;input.html&quot;</span><span class="Punctuation">)</span>
<span class="Keyword">for</span> <span class="Identifier">a</span> <span class="Keyword">in</span> <span class="Identifier">html</span><span class="Operator">.</span><span class="Identifier">findAll</span><span class="Punctuation">(</span><span class="StringLit">&quot;a&quot;</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
<span class="Keyword">if</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">attrs</span><span class="Operator">.</span><span class="Identifier">hasKey</span> <span class="StringLit">&quot;href&quot;</span><span class="Punctuation">:</span>
<span class="Keyword">let</span> <span class="Punctuation">(</span><span class="Identifier">dir</span><span class="Punctuation">,</span> <span class="Identifier">filename</span><span class="Punctuation">,</span> <span class="Identifier">ext</span><span class="Punctuation">)</span> <span class="Operator">=</span> <span class="Identifier">splitFile</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">attrs</span><span class="Punctuation">[</span><span class="StringLit">&quot;href&quot;</span><span class="Punctuation">]</span><span class="Punctuation">)</span>
<span class="Keyword">if</span> <span class="Identifier">cmpIgnoreCase</span><span class="Punctuation">(</span><span class="Identifier">ext</span><span class="Punctuation">,</span> <span class="StringLit">&quot;.rst&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">0</span><span class="Punctuation">:</span>
<span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">attrs</span><span class="Punctuation">[</span><span class="StringLit">&quot;href&quot;</span><span class="Punctuation">]</span> <span class="Operator">=</span> <span class="Identifier">dir</span> <span class="Operator">/</span> <span class="Identifier">filename</span> <span class="Operator">&amp;</span> <span class="StringLit">&quot;.html&quot;</span>
<span class="Identifier">writeFile</span><span class="Punctuation">(</span><span class="StringLit">&quot;output.html&quot;</span><span class="Punctuation">,</span> <span class="Operator">$</span><span class="Identifier">html</span><span class="Punctuation">)</span></pre></p>
</p>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="HtmlTag">
<dt><pre><a href="htmlparser.html#HtmlTag"><span class="Identifier">HtmlTag</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">tagUnknown</span><span class="Other">,</span> <span class="Comment">## unknown HTML element</span>
<span class="Identifier">tagA</span><span class="Other">,</span> <span class="Comment">## the HTML `a` element</span>
<span class="Identifier">tagAbbr</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `abbr` element</span>
<span class="Identifier">tagAcronym</span><span class="Other">,</span> <span class="Comment">## the HTML `acronym` element</span>
<span class="Identifier">tagAddress</span><span class="Other">,</span> <span class="Comment">## the HTML `address` element</span>
<span class="Identifier">tagApplet</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `applet` element</span>
<span class="Identifier">tagArea</span><span class="Other">,</span> <span class="Comment">## the HTML `area` element</span>
<span class="Identifier">tagArticle</span><span class="Other">,</span> <span class="Comment">## the HTML `article` element</span>
<span class="Identifier">tagAside</span><span class="Other">,</span> <span class="Comment">## the HTML `aside` element</span>
<span class="Identifier">tagAudio</span><span class="Other">,</span> <span class="Comment">## the HTML `audio` element</span>
<span class="Identifier">tagB</span><span class="Other">,</span> <span class="Comment">## the HTML `b` element</span>
<span class="Identifier">tagBase</span><span class="Other">,</span> <span class="Comment">## the HTML `base` element</span>
<span class="Identifier">tagBdi</span><span class="Other">,</span> <span class="Comment">## the HTML `bdi` element</span>
<span class="Identifier">tagBdo</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `dbo` element</span>
<span class="Identifier">tagBasefont</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `basefont` element</span>
<span class="Identifier">tagBig</span><span class="Other">,</span> <span class="Comment">## the HTML `big` element</span>
<span class="Identifier">tagBlockquote</span><span class="Other">,</span> <span class="Comment">## the HTML `blockquote` element</span>
<span class="Identifier">tagBody</span><span class="Other">,</span> <span class="Comment">## the HTML `body` element</span>
<span class="Identifier">tagBr</span><span class="Other">,</span> <span class="Comment">## the HTML `br` element</span>
<span class="Identifier">tagButton</span><span class="Other">,</span> <span class="Comment">## the HTML `button` element</span>
<span class="Identifier">tagCanvas</span><span class="Other">,</span> <span class="Comment">## the HTML `canvas` element</span>
<span class="Identifier">tagCaption</span><span class="Other">,</span> <span class="Comment">## the HTML `caption` element</span>
<span class="Identifier">tagCenter</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `center` element</span>
<span class="Identifier">tagCite</span><span class="Other">,</span> <span class="Comment">## the HTML `cite` element</span>
<span class="Identifier">tagCode</span><span class="Other">,</span> <span class="Comment">## the HTML `code` element</span>
<span class="Identifier">tagCol</span><span class="Other">,</span> <span class="Comment">## the HTML `col` element</span>
<span class="Identifier">tagColgroup</span><span class="Other">,</span> <span class="Comment">## the HTML `colgroup` element</span>
<span class="Identifier">tagCommand</span><span class="Other">,</span> <span class="Comment">## the HTML `command` element</span>
<span class="Identifier">tagDatalist</span><span class="Other">,</span> <span class="Comment">## the HTML `datalist` element</span>
<span class="Identifier">tagDd</span><span class="Other">,</span> <span class="Comment">## the HTML `dd` element</span>
<span class="Identifier">tagDel</span><span class="Other">,</span> <span class="Comment">## the HTML `del` element</span>
<span class="Identifier">tagDetails</span><span class="Other">,</span> <span class="Comment">## the HTML `details` element</span>
<span class="Identifier">tagDfn</span><span class="Other">,</span> <span class="Comment">## the HTML `dfn` element</span>
<span class="Identifier">tagDialog</span><span class="Other">,</span> <span class="Comment">## the HTML `dialog` element</span>
<span class="Identifier">tagDiv</span><span class="Other">,</span> <span class="Comment">## the HTML `div` element</span>
<span class="Identifier">tagDir</span><span class="Other">,</span> <span class="Comment">## the deprecated HTLM `dir` element</span>
<span class="Identifier">tagDl</span><span class="Other">,</span> <span class="Comment">## the HTML `dl` element</span>
<span class="Identifier">tagDt</span><span class="Other">,</span> <span class="Comment">## the HTML `dt` element</span>
<span class="Identifier">tagEm</span><span class="Other">,</span> <span class="Comment">## the HTML `em` element</span>
<span class="Identifier">tagEmbed</span><span class="Other">,</span> <span class="Comment">## the HTML `embed` element</span>
<span class="Identifier">tagFieldset</span><span class="Other">,</span> <span class="Comment">## the HTML `fieldset` element</span>
<span class="Identifier">tagFigcaption</span><span class="Other">,</span> <span class="Comment">## the HTML `figcaption` element</span>
<span class="Identifier">tagFigure</span><span class="Other">,</span> <span class="Comment">## the HTML `figure` element</span>
<span class="Identifier">tagFont</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `font` element</span>
<span class="Identifier">tagFooter</span><span class="Other">,</span> <span class="Comment">## the HTML `footer` element</span>
<span class="Identifier">tagForm</span><span class="Other">,</span> <span class="Comment">## the HTML `form` element</span>
<span class="Identifier">tagFrame</span><span class="Other">,</span> <span class="Comment">## the HTML `frame` element</span>
<span class="Identifier">tagFrameset</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `frameset` element</span>
<span class="Identifier">tagH1</span><span class="Other">,</span> <span class="Comment">## the HTML `h1` element</span>
<span class="Identifier">tagH2</span><span class="Other">,</span> <span class="Comment">## the HTML `h2` element</span>
<span class="Identifier">tagH3</span><span class="Other">,</span> <span class="Comment">## the HTML `h3` element</span>
<span class="Identifier">tagH4</span><span class="Other">,</span> <span class="Comment">## the HTML `h4` element</span>
<span class="Identifier">tagH5</span><span class="Other">,</span> <span class="Comment">## the HTML `h5` element</span>
<span class="Identifier">tagH6</span><span class="Other">,</span> <span class="Comment">## the HTML `h6` element</span>
<span class="Identifier">tagHead</span><span class="Other">,</span> <span class="Comment">## the HTML `head` element</span>
<span class="Identifier">tagHeader</span><span class="Other">,</span> <span class="Comment">## the HTML `header` element</span>
<span class="Identifier">tagHgroup</span><span class="Other">,</span> <span class="Comment">## the HTML `hgroup` element</span>
<span class="Identifier">tagHtml</span><span class="Other">,</span> <span class="Comment">## the HTML `html` element</span>
<span class="Identifier">tagHr</span><span class="Other">,</span> <span class="Comment">## the HTML `hr` element</span>
<span class="Identifier">tagI</span><span class="Other">,</span> <span class="Comment">## the HTML `i` element</span>
<span class="Identifier">tagIframe</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `iframe` element</span>
<span class="Identifier">tagImg</span><span class="Other">,</span> <span class="Comment">## the HTML `img` element</span>
<span class="Identifier">tagInput</span><span class="Other">,</span> <span class="Comment">## the HTML `input` element</span>
<span class="Identifier">tagIns</span><span class="Other">,</span> <span class="Comment">## the HTML `ins` element</span>
<span class="Identifier">tagIsindex</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `isindex` element</span>
<span class="Identifier">tagKbd</span><span class="Other">,</span> <span class="Comment">## the HTML `kbd` element</span>
<span class="Identifier">tagKeygen</span><span class="Other">,</span> <span class="Comment">## the HTML `keygen` element</span>
<span class="Identifier">tagLabel</span><span class="Other">,</span> <span class="Comment">## the HTML `label` element</span>
<span class="Identifier">tagLegend</span><span class="Other">,</span> <span class="Comment">## the HTML `legend` element</span>
<span class="Identifier">tagLi</span><span class="Other">,</span> <span class="Comment">## the HTML `li` element</span>
<span class="Identifier">tagLink</span><span class="Other">,</span> <span class="Comment">## the HTML `link` element</span>
<span class="Identifier">tagMap</span><span class="Other">,</span> <span class="Comment">## the HTML `map` element</span>
<span class="Identifier">tagMark</span><span class="Other">,</span> <span class="Comment">## the HTML `mark` element</span>
<span class="Identifier">tagMenu</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `menu` element</span>
<span class="Identifier">tagMeta</span><span class="Other">,</span> <span class="Comment">## the HTML `meta` element</span>
<span class="Identifier">tagMeter</span><span class="Other">,</span> <span class="Comment">## the HTML `meter` element</span>
<span class="Identifier">tagNav</span><span class="Other">,</span> <span class="Comment">## the HTML `nav` element</span>
<span class="Identifier">tagNobr</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `nobr` element</span>
<span class="Identifier">tagNoframes</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `noframes` element</span>
<span class="Identifier">tagNoscript</span><span class="Other">,</span> <span class="Comment">## the HTML `noscript` element</span>
<span class="Identifier">tagObject</span><span class="Other">,</span> <span class="Comment">## the HTML `object` element</span>
<span class="Identifier">tagOl</span><span class="Other">,</span> <span class="Comment">## the HTML `ol` element</span>
<span class="Identifier">tagOptgroup</span><span class="Other">,</span> <span class="Comment">## the HTML `optgroup` element</span>
<span class="Identifier">tagOption</span><span class="Other">,</span> <span class="Comment">## the HTML `option` element</span>
<span class="Identifier">tagOutput</span><span class="Other">,</span> <span class="Comment">## the HTML `output` element</span>
<span class="Identifier">tagP</span><span class="Other">,</span> <span class="Comment">## the HTML `p` element</span>
<span class="Identifier">tagParam</span><span class="Other">,</span> <span class="Comment">## the HTML `param` element</span>
<span class="Identifier">tagPre</span><span class="Other">,</span> <span class="Comment">## the HTML `pre` element</span>
<span class="Identifier">tagProgress</span><span class="Other">,</span> <span class="Comment">## the HTML `progress` element</span>
<span class="Identifier">tagQ</span><span class="Other">,</span> <span class="Comment">## the HTML `q` element</span>
<span class="Identifier">tagRp</span><span class="Other">,</span> <span class="Comment">## the HTML `rp` element</span>
<span class="Identifier">tagRt</span><span class="Other">,</span> <span class="Comment">## the HTML `rt` element</span>
<span class="Identifier">tagRuby</span><span class="Other">,</span> <span class="Comment">## the HTML `ruby` element</span>
<span class="Identifier">tagS</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `s` element</span>
<span class="Identifier">tagSamp</span><span class="Other">,</span> <span class="Comment">## the HTML `samp` element</span>
<span class="Identifier">tagScript</span><span class="Other">,</span> <span class="Comment">## the HTML `script` element</span>
<span class="Identifier">tagSection</span><span class="Other">,</span> <span class="Comment">## the HTML `section` element</span>
<span class="Identifier">tagSelect</span><span class="Other">,</span> <span class="Comment">## the HTML `select` element</span>
<span class="Identifier">tagSmall</span><span class="Other">,</span> <span class="Comment">## the HTML `small` element</span>
<span class="Identifier">tagSource</span><span class="Other">,</span> <span class="Comment">## the HTML `source` element</span>
<span class="Identifier">tagSpan</span><span class="Other">,</span> <span class="Comment">## the HTML `span` element</span>
<span class="Identifier">tagStrike</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `strike` element</span>
<span class="Identifier">tagStrong</span><span class="Other">,</span> <span class="Comment">## the HTML `strong` element</span>
<span class="Identifier">tagStyle</span><span class="Other">,</span> <span class="Comment">## the HTML `style` element</span>
<span class="Identifier">tagSub</span><span class="Other">,</span> <span class="Comment">## the HTML `sub` element</span>
<span class="Identifier">tagSummary</span><span class="Other">,</span> <span class="Comment">## the HTML `summary` element</span>
<span class="Identifier">tagSup</span><span class="Other">,</span> <span class="Comment">## the HTML `sup` element</span>
<span class="Identifier">tagTable</span><span class="Other">,</span> <span class="Comment">## the HTML `table` element</span>
<span class="Identifier">tagTbody</span><span class="Other">,</span> <span class="Comment">## the HTML `tbody` element</span>
<span class="Identifier">tagTd</span><span class="Other">,</span> <span class="Comment">## the HTML `td` element</span>
<span class="Identifier">tagTextarea</span><span class="Other">,</span> <span class="Comment">## the HTML `textarea` element</span>
<span class="Identifier">tagTfoot</span><span class="Other">,</span> <span class="Comment">## the HTML `tfoot` element</span>
<span class="Identifier">tagTh</span><span class="Other">,</span> <span class="Comment">## the HTML `th` element</span>
<span class="Identifier">tagThead</span><span class="Other">,</span> <span class="Comment">## the HTML `thead` element</span>
<span class="Identifier">tagTime</span><span class="Other">,</span> <span class="Comment">## the HTML `time` element</span>
<span class="Identifier">tagTitle</span><span class="Other">,</span> <span class="Comment">## the HTML `title` element</span>
<span class="Identifier">tagTr</span><span class="Other">,</span> <span class="Comment">## the HTML `tr` element</span>
<span class="Identifier">tagTrack</span><span class="Other">,</span> <span class="Comment">## the HTML `track` element</span>
<span class="Identifier">tagTt</span><span class="Other">,</span> <span class="Comment">## the HTML `tt` element</span>
<span class="Identifier">tagU</span><span class="Other">,</span> <span class="Comment">## the deprecated HTML `u` element</span>
<span class="Identifier">tagUl</span><span class="Other">,</span> <span class="Comment">## the HTML `ul` element</span>
<span class="Identifier">tagVar</span><span class="Other">,</span> <span class="Comment">## the HTML `var` element</span>
<span class="Identifier">tagVideo</span><span class="Other">,</span> <span class="Comment">## the HTML `video` element</span>
<span class="Identifier">tagWbr</span> <span class="Comment">## the HTML `wbr` element</span></pre></dt>
<dd>
list of all supported HTML tags; order will always be alphabetically
</dd>
</div>
</dl>
</div>
<div class="section" id="10">
<h1><a class="toc-backref" href="#10">Consts</a></h1>
<dl class="item">
<div id="BlockTags">
<dt><pre><a href="htmlparser.html#BlockTags"><span class="Identifier">BlockTags</span></a> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">tagAddress</span><span class="Other">,</span> <span class="DecNumber">tagBlockquote</span><span class="Other">,</span> <span class="DecNumber">tagCenter</span><span class="Other">,</span> <span class="DecNumber">tagDel</span><span class="Other">,</span> <span class="DecNumber">tagDir</span><span class="Other">,</span> <span class="DecNumber">tagDiv</span><span class="Other">,</span>
<span class="DecNumber">tagDl</span><span class="Other">,</span> <span class="DecNumber">tagFieldset</span><span class="Other">,</span> <span class="DecNumber">tagForm</span><span class="Other">,</span> <span class="DecNumber">tagH1</span><span class="Other">,</span> <span class="DecNumber">tagH2</span><span class="Other">,</span> <span class="DecNumber">tagH3</span><span class="Other">,</span> <span class="DecNumber">tagH4</span><span class="Other">,</span> <span class="DecNumber">tagH5</span><span class="Other">,</span>
<span class="DecNumber">tagH6</span><span class="Other">,</span> <span class="DecNumber">tagHr</span><span class="Other">,</span> <span class="DecNumber">tagIns</span><span class="Other">,</span> <span class="DecNumber">tagIsindex</span><span class="Other">,</span> <span class="DecNumber">tagMenu</span><span class="Other">,</span> <span class="DecNumber">tagNoframes</span><span class="Other">,</span>
<span class="DecNumber">tagNoscript</span><span class="Other">,</span> <span class="DecNumber">tagOl</span><span class="Other">,</span> <span class="DecNumber">tagP</span><span class="Other">,</span> <span class="DecNumber">tagPre</span><span class="Other">,</span> <span class="DecNumber">tagTable</span><span class="Other">,</span> <span class="DecNumber">tagUl</span><span class="Other">,</span> <span class="DecNumber">tagCenter</span><span class="Other">,</span>
<span class="DecNumber">tagDir</span><span class="Other">,</span> <span class="DecNumber">tagIsindex</span><span class="Other">,</span> <span class="DecNumber">tagMenu</span><span class="Other">,</span> <span class="DecNumber">tagNoframes</span><span class="Other">}</span></pre></dt>
<dd>
</dd>
</div>
<div id="InlineTags">
<dt><pre><a href="htmlparser.html#InlineTags"><span class="Identifier">InlineTags</span></a> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">tagA</span><span class="Other">,</span> <span class="DecNumber">tagAbbr</span><span class="Other">,</span> <span class="DecNumber">tagAcronym</span><span class="Other">,</span> <span class="DecNumber">tagApplet</span><span class="Other">,</span> <span class="DecNumber">tagB</span><span class="Other">,</span> <span class="DecNumber">tagBasefont</span><span class="Other">,</span> <span class="DecNumber">tagBdo</span><span class="Other">,</span>
<span class="DecNumber">tagBig</span><span class="Other">,</span> <span class="DecNumber">tagBr</span><span class="Other">,</span> <span class="DecNumber">tagButton</span><span class="Other">,</span> <span class="DecNumber">tagCite</span><span class="Other">,</span> <span class="DecNumber">tagCode</span><span class="Other">,</span> <span class="DecNumber">tagDel</span><span class="Other">,</span> <span class="DecNumber">tagDfn</span><span class="Other">,</span> <span class="DecNumber">tagEm</span><span class="Other">,</span>
<span class="DecNumber">tagFont</span><span class="Other">,</span> <span class="DecNumber">tagI</span><span class="Other">,</span> <span class="DecNumber">tagImg</span><span class="Other">,</span> <span class="DecNumber">tagIns</span><span class="Other">,</span> <span class="DecNumber">tagInput</span><span class="Other">,</span> <span class="DecNumber">tagIframe</span><span class="Other">,</span> <span class="DecNumber">tagKbd</span><span class="Other">,</span>
<span class="DecNumber">tagLabel</span><span class="Other">,</span> <span class="DecNumber">tagMap</span><span class="Other">,</span> <span class="DecNumber">tagObject</span><span class="Other">,</span> <span class="DecNumber">tagQ</span><span class="Other">,</span> <span class="DecNumber">tagSamp</span><span class="Other">,</span> <span class="DecNumber">tagScript</span><span class="Other">,</span> <span class="DecNumber">tagSelect</span><span class="Other">,</span>
<span class="DecNumber">tagSmall</span><span class="Other">,</span> <span class="DecNumber">tagSpan</span><span class="Other">,</span> <span class="DecNumber">tagStrong</span><span class="Other">,</span> <span class="DecNumber">tagSub</span><span class="Other">,</span> <span class="DecNumber">tagSup</span><span class="Other">,</span> <span class="DecNumber">tagTextarea</span><span class="Other">,</span> <span class="DecNumber">tagTt</span><span class="Other">,</span>
<span class="DecNumber">tagVar</span><span class="Other">,</span> <span class="DecNumber">tagApplet</span><span class="Other">,</span> <span class="DecNumber">tagBasefont</span><span class="Other">,</span> <span class="DecNumber">tagFont</span><span class="Other">,</span> <span class="DecNumber">tagIframe</span><span class="Other">,</span> <span class="DecNumber">tagU</span><span class="Other">,</span> <span class="DecNumber">tagS</span><span class="Other">,</span>
<span class="DecNumber">tagStrike</span><span class="Other">,</span> <span class="DecNumber">tagWbr</span><span class="Other">}</span></pre></dt>
<dd>
</dd>
</div>
<div id="SingleTags">
<dt><pre><a href="htmlparser.html#SingleTags"><span class="Identifier">SingleTags</span></a> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">tagArea</span><span class="Other">,</span> <span class="DecNumber">tagBase</span><span class="Other">,</span> <span class="DecNumber">tagBasefont</span><span class="Other">,</span> <span class="DecNumber">tagBr</span><span class="Other">,</span> <span class="DecNumber">tagCol</span><span class="Other">,</span> <span class="DecNumber">tagFrame</span><span class="Other">,</span> <span class="DecNumber">tagHr</span><span class="Other">,</span>
<span class="DecNumber">tagImg</span><span class="Other">,</span> <span class="DecNumber">tagIsindex</span><span class="Other">,</span> <span class="DecNumber">tagLink</span><span class="Other">,</span> <span class="DecNumber">tagMeta</span><span class="Other">,</span> <span class="DecNumber">tagParam</span><span class="Other">,</span> <span class="DecNumber">tagWbr</span><span class="Other">,</span> <span class="DecNumber">tagSource</span><span class="Other">}</span></pre></dt>
<dd>
</dd>
</div>
<div id="tagToStr">
<dt><pre><a href="htmlparser.html#tagToStr"><span class="Identifier">tagToStr</span></a> <span class="Other">=</span> <span class="Other">[</span><span class="StringLit">&quot;a&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;abbr&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;acronym&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;address&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;applet&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;area&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;article&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;aside&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;audio&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;b&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;base&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;basefont&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;bdi&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;bdo&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;big&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;blockquote&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;body&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;br&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;button&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;canvas&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;caption&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;center&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;cite&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;code&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;col&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;colgroup&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;command&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;datalist&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;dd&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;del&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;details&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;dfn&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;dialog&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;div&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;dir&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;dl&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;dt&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;em&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;embed&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;fieldset&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;figcaption&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;figure&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;font&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;footer&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;form&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;frame&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;frameset&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;h1&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;h2&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;h3&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;h4&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;h5&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;h6&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;head&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;header&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;hgroup&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;html&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;hr&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;i&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;iframe&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;img&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;input&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;ins&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;isindex&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;kbd&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;keygen&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;label&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;legend&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;li&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;link&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;map&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;mark&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;menu&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;meta&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;meter&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;nav&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;nobr&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;noframes&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;noscript&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;object&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;ol&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;optgroup&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;option&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;output&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;p&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;param&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;pre&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;progress&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;q&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;rp&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;rt&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;ruby&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;s&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;samp&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;script&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;section&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;select&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;small&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;source&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;span&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;strike&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;strong&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;style&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;sub&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;summary&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;sup&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;table&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;tbody&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;td&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;textarea&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;tfoot&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;th&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;thead&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;time&quot;</span><span class="Other">,</span>
<span class="StringLit">&quot;title&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;tr&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;track&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;tt&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;u&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;ul&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;var&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;video&quot;</span><span class="Other">,</span> <span class="StringLit">&quot;wbr&quot;</span><span class="Other">]</span></pre></dt>
<dd>
</dd>
</div>
</dl>
</div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<div id="entityToRune-procs-all">
<div id="entityToRune,string">
<dt><pre><span class="Keyword">proc</span> <a href="#entityToRune%2Cstring"><span class="Identifier">entityToRune</span></a><span class="Other">(</span><span class="Identifier">entity</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Rune</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Converts an HTML entity name like <tt class="docutils literal"><span class="pre"><span class="Operator">&amp;</span><span class="Identifier">Uuml</span><span class="Punctuation">;</span></span></tt> or values like <tt class="docutils literal"><span class="pre"><span class="Operator">&amp;</span><span class="Comment">#220;</span></span></tt> or <tt class="docutils literal"><span class="pre"><span class="Operator">&amp;</span><span class="Comment">#x000DC;</span></span></tt> to its UTF-8 equivalent. Rune(0) is returned if the entity name is unknown.
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Identifier">unicode</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToRune</span><span class="Punctuation">(</span><span class="StringLit">&quot;&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">Rune</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToRune</span><span class="Punctuation">(</span><span class="StringLit">&quot;a&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">Rune</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToRune</span><span class="Punctuation">(</span><span class="StringLit">&quot;gt&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;&gt;&quot;</span><span class="Operator">.</span><span class="Identifier">runeAt</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToRune</span><span class="Punctuation">(</span><span class="StringLit">&quot;Uuml&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;Ü&quot;</span><span class="Operator">.</span><span class="Identifier">runeAt</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToRune</span><span class="Punctuation">(</span><span class="StringLit">&quot;quest&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;?&quot;</span><span class="Operator">.</span><span class="Identifier">runeAt</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToRune</span><span class="Punctuation">(</span><span class="StringLit">&quot;#x0003F&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;?&quot;</span><span class="Operator">.</span><span class="Identifier">runeAt</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span></pre>
</dd>
</div>
</div>
<div id="entityToUtf8-procs-all">
<div id="entityToUtf8,string">
<dt><pre><span class="Keyword">proc</span> <a href="#entityToUtf8%2Cstring"><span class="Identifier">entityToUtf8</span></a><span class="Other">(</span><span class="Identifier">entity</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Converts an HTML entity name like <tt class="docutils literal"><span class="pre"><span class="Operator">&amp;</span><span class="Identifier">Uuml</span><span class="Punctuation">;</span></span></tt> or values like <tt class="docutils literal"><span class="pre"><span class="Operator">&amp;</span><span class="Comment">#220;</span></span></tt> or <tt class="docutils literal"><span class="pre"><span class="Operator">&amp;</span><span class="Comment">#x000DC;</span></span></tt> to its UTF-8 equivalent. &quot;&quot; is returned if the entity name is unknown. The HTML parser already converts entities to UTF-8.
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">const</span> <span class="Identifier">sigma</span> <span class="Operator">=</span> <span class="StringLit">&quot;Σ&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;a&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;gt&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;&gt;&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;Uuml&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;Ü&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;quest&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;?&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;#63&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;?&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;Sigma&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">sigma</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;#931&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">sigma</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;#0931&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">sigma</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;#x3A3&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">sigma</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;#x03A3&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">sigma</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;#x3a3&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">sigma</span>
<span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">&quot;#X3a3&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">sigma</span></pre>
</dd>
</div>
</div>
<div id="htmlTag-procs-all">
<div id="htmlTag,XmlNode">
<dt><pre><span class="Keyword">proc</span> <a href="#htmlTag%2CXmlNode"><span class="Identifier">htmlTag</span></a><span class="Other">(</span><span class="Identifier">n</span><span class="Other">:</span> <span class="Identifier">XmlNode</span><span class="Other">)</span><span class="Other">:</span> <a href="htmlparser.html#HtmlTag"><span class="Identifier">HtmlTag</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Gets <tt class="docutils literal"><span class="pre"><span class="Identifier">n</span></span></tt>'s tag as a <tt class="docutils literal"><span class="pre"><span class="Identifier">HtmlTag</span></span></tt>.
</dd>
</div>
<div id="htmlTag,string">
<dt><pre><span class="Keyword">proc</span> <a href="#htmlTag%2Cstring"><span class="Identifier">htmlTag</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="htmlparser.html#HtmlTag"><span class="Identifier">HtmlTag</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Converts <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> to a <tt class="docutils literal"><span class="pre"><span class="Identifier">HtmlTag</span></span></tt>. If <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> is no HTML tag, <tt class="docutils literal"><span class="pre"><span class="Identifier">tagUnknown</span></span></tt> is returned.
</dd>
</div>
</div>
<div id="loadHtml-procs-all">
<div id="loadHtml,string">
<dt><pre><span class="Keyword">proc</span> <a href="#loadHtml%2Cstring"><span class="Identifier">loadHtml</span></a><span class="Other">(</span><span class="Identifier">path</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">XmlNode</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span>
<span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Loads and parses HTML from file specified by <tt class="docutils literal"><span class="pre"><span class="Identifier">path</span></span></tt>, and returns a <tt class="docutils literal"><span class="pre"><span class="Identifier">XmlNode</span></span></tt>. All parsing errors are ignored.
</dd>
</div>
<div id="loadHtml,string,seq[string]">
<dt><pre><span class="Keyword">proc</span> <a href="#loadHtml%2Cstring%2Cseq%5Bstring%5D"><span class="Identifier">loadHtml</span></a><span class="Other">(</span><span class="Identifier">path</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">errors</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">XmlNode</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Loads and parses HTML from file specified by <tt class="docutils literal"><span class="pre"><span class="Identifier">path</span></span></tt>, and returns a <tt class="docutils literal"><span class="pre"><span class="Identifier">XmlNode</span></span></tt>. Every occurred parsing error is added to the <tt class="docutils literal"><span class="pre"><span class="Identifier">errors</span></span></tt> sequence.
</dd>
</div>
</div>
<div id="parseHtml-procs-all">
<div id="parseHtml,string">
<dt><pre><span class="Keyword">proc</span> <a href="#parseHtml%2Cstring"><span class="Identifier">parseHtml</span></a><span class="Other">(</span><span class="Identifier">html</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">XmlNode</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span>
<span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Parses the HTML from string <tt class="docutils literal"><span class="pre"><span class="Identifier">html</span></span></tt> and returns a <tt class="docutils literal"><span class="pre"><span class="Identifier">XmlNode</span></span></tt>. All parsing errors are ignored.
</dd>
</div>
<div id="parseHtml,Stream">
<dt><pre><span class="Keyword">proc</span> <a href="#parseHtml%2CStream"><span class="Identifier">parseHtml</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">Stream</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">XmlNode</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span>
<span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Parses the HTML from stream <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> and returns a <tt class="docutils literal"><span class="pre"><span class="Identifier">XmlNode</span></span></tt>. All parsing errors are ignored.
</dd>
</div>
<div id="parseHtml,Stream,string,seq[string]">
<dt><pre><span class="Keyword">proc</span> <a href="#parseHtml%2CStream%2Cstring%2Cseq%5Bstring%5D"><span class="Identifier">parseHtml</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">Stream</span><span class="Other">;</span> <span class="Identifier">filename</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">errors</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">XmlNode</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Parses the XML from stream <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> and returns a <tt class="docutils literal"><span class="pre"><span class="Identifier">XmlNode</span></span></tt>. Every occurred parsing error is added to the <tt class="docutils literal"><span class="pre"><span class="Identifier">errors</span></span></tt> sequence.
</dd>
</div>
</div>
<div id="runeToEntity-procs-all">
<div id="runeToEntity,Rune">
<dt><pre><span class="Keyword">proc</span> <a href="#runeToEntity%2CRune"><span class="Identifier">runeToEntity</span></a><span class="Other">(</span><span class="Identifier">rune</span><span class="Other">:</span> <span class="Identifier">Rune</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
converts a Rune to its numeric HTML entity equivalent.
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Identifier">unicode</span>
<span class="Identifier">doAssert</span> <span class="Identifier">runeToEntity</span><span class="Punctuation">(</span><span class="Identifier">Rune</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">runeToEntity</span><span class="Punctuation">(</span><span class="Identifier">Rune</span><span class="Punctuation">(</span><span class="Operator">-</span><span class="DecNumber">1</span><span class="Punctuation">)</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">runeToEntity</span><span class="Punctuation">(</span><span class="StringLit">&quot;Ü&quot;</span><span class="Operator">.</span><span class="Identifier">runeAt</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;#220&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">runeToEntity</span><span class="Punctuation">(</span><span class="StringLit">&quot;&quot;</span><span class="Operator">.</span><span class="Identifier">runeAt</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;#8712&quot;</span></pre>
</dd>
</div>
</div>
</dl>
</div>
</div>
</div>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br>
<small style="color: var(--hint);">Made with Nim. Generated: 2025-12-28 15:55:41 UTC</small>
</div>
</div>
</div>
<script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
</body>
</html>