123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652 |
- <?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: </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 = ["a", "abbr", "acronym", "address", "applet", "area", "article",
- "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "big",
- "blockquote", "body", "br", "button", "canvas", "caption", "center",
- "cite", "code", "col", "colgroup", "command", "datalist", "dd",
- "del", "details", "dfn", "dialog", "div", "dir", "dl", "dt", "em",
- "embed", "fieldset", "figcaption", "figure", "font", "footer",
- "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6",
- "head", "header", "hgroup", "html", "hr", "i", "iframe", "img",
- "input", "ins", "isindex", "kbd", "keygen", "label", "legend", "li",
- "link", "map", "mark", "menu", "meta", "meter", "nav", "nobr",
- "noframes", "noscript", "object", "ol", "optgroup", "option",
- "output", "p", "param", "pre", "progress", "q", "rp", "rt", "ruby",
- "s", "samp", "script", "section", "select", "small", "source",
- "span", "strike", "strong", "style", "sub", "summary", "sup",
- "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time",
- "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]">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 "<em>wild</em> HTML the real world uses" 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">"mydirty.html"</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">"input.html"</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">"a"</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">"href"</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">"href"</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">".rst"</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">"href"</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">&</span> <span class="StringLit">".html"</span>
-
- <span class="Identifier">writeFile</span><span class="Punctuation">(</span><span class="StringLit">"output.html"</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">"a"</span><span class="Other">,</span> <span class="StringLit">"abbr"</span><span class="Other">,</span> <span class="StringLit">"acronym"</span><span class="Other">,</span> <span class="StringLit">"address"</span><span class="Other">,</span> <span class="StringLit">"applet"</span><span class="Other">,</span> <span class="StringLit">"area"</span><span class="Other">,</span> <span class="StringLit">"article"</span><span class="Other">,</span>
- <span class="StringLit">"aside"</span><span class="Other">,</span> <span class="StringLit">"audio"</span><span class="Other">,</span> <span class="StringLit">"b"</span><span class="Other">,</span> <span class="StringLit">"base"</span><span class="Other">,</span> <span class="StringLit">"basefont"</span><span class="Other">,</span> <span class="StringLit">"bdi"</span><span class="Other">,</span> <span class="StringLit">"bdo"</span><span class="Other">,</span> <span class="StringLit">"big"</span><span class="Other">,</span>
- <span class="StringLit">"blockquote"</span><span class="Other">,</span> <span class="StringLit">"body"</span><span class="Other">,</span> <span class="StringLit">"br"</span><span class="Other">,</span> <span class="StringLit">"button"</span><span class="Other">,</span> <span class="StringLit">"canvas"</span><span class="Other">,</span> <span class="StringLit">"caption"</span><span class="Other">,</span> <span class="StringLit">"center"</span><span class="Other">,</span>
- <span class="StringLit">"cite"</span><span class="Other">,</span> <span class="StringLit">"code"</span><span class="Other">,</span> <span class="StringLit">"col"</span><span class="Other">,</span> <span class="StringLit">"colgroup"</span><span class="Other">,</span> <span class="StringLit">"command"</span><span class="Other">,</span> <span class="StringLit">"datalist"</span><span class="Other">,</span> <span class="StringLit">"dd"</span><span class="Other">,</span>
- <span class="StringLit">"del"</span><span class="Other">,</span> <span class="StringLit">"details"</span><span class="Other">,</span> <span class="StringLit">"dfn"</span><span class="Other">,</span> <span class="StringLit">"dialog"</span><span class="Other">,</span> <span class="StringLit">"div"</span><span class="Other">,</span> <span class="StringLit">"dir"</span><span class="Other">,</span> <span class="StringLit">"dl"</span><span class="Other">,</span> <span class="StringLit">"dt"</span><span class="Other">,</span> <span class="StringLit">"em"</span><span class="Other">,</span>
- <span class="StringLit">"embed"</span><span class="Other">,</span> <span class="StringLit">"fieldset"</span><span class="Other">,</span> <span class="StringLit">"figcaption"</span><span class="Other">,</span> <span class="StringLit">"figure"</span><span class="Other">,</span> <span class="StringLit">"font"</span><span class="Other">,</span> <span class="StringLit">"footer"</span><span class="Other">,</span>
- <span class="StringLit">"form"</span><span class="Other">,</span> <span class="StringLit">"frame"</span><span class="Other">,</span> <span class="StringLit">"frameset"</span><span class="Other">,</span> <span class="StringLit">"h1"</span><span class="Other">,</span> <span class="StringLit">"h2"</span><span class="Other">,</span> <span class="StringLit">"h3"</span><span class="Other">,</span> <span class="StringLit">"h4"</span><span class="Other">,</span> <span class="StringLit">"h5"</span><span class="Other">,</span> <span class="StringLit">"h6"</span><span class="Other">,</span>
- <span class="StringLit">"head"</span><span class="Other">,</span> <span class="StringLit">"header"</span><span class="Other">,</span> <span class="StringLit">"hgroup"</span><span class="Other">,</span> <span class="StringLit">"html"</span><span class="Other">,</span> <span class="StringLit">"hr"</span><span class="Other">,</span> <span class="StringLit">"i"</span><span class="Other">,</span> <span class="StringLit">"iframe"</span><span class="Other">,</span> <span class="StringLit">"img"</span><span class="Other">,</span>
- <span class="StringLit">"input"</span><span class="Other">,</span> <span class="StringLit">"ins"</span><span class="Other">,</span> <span class="StringLit">"isindex"</span><span class="Other">,</span> <span class="StringLit">"kbd"</span><span class="Other">,</span> <span class="StringLit">"keygen"</span><span class="Other">,</span> <span class="StringLit">"label"</span><span class="Other">,</span> <span class="StringLit">"legend"</span><span class="Other">,</span> <span class="StringLit">"li"</span><span class="Other">,</span>
- <span class="StringLit">"link"</span><span class="Other">,</span> <span class="StringLit">"map"</span><span class="Other">,</span> <span class="StringLit">"mark"</span><span class="Other">,</span> <span class="StringLit">"menu"</span><span class="Other">,</span> <span class="StringLit">"meta"</span><span class="Other">,</span> <span class="StringLit">"meter"</span><span class="Other">,</span> <span class="StringLit">"nav"</span><span class="Other">,</span> <span class="StringLit">"nobr"</span><span class="Other">,</span>
- <span class="StringLit">"noframes"</span><span class="Other">,</span> <span class="StringLit">"noscript"</span><span class="Other">,</span> <span class="StringLit">"object"</span><span class="Other">,</span> <span class="StringLit">"ol"</span><span class="Other">,</span> <span class="StringLit">"optgroup"</span><span class="Other">,</span> <span class="StringLit">"option"</span><span class="Other">,</span>
- <span class="StringLit">"output"</span><span class="Other">,</span> <span class="StringLit">"p"</span><span class="Other">,</span> <span class="StringLit">"param"</span><span class="Other">,</span> <span class="StringLit">"pre"</span><span class="Other">,</span> <span class="StringLit">"progress"</span><span class="Other">,</span> <span class="StringLit">"q"</span><span class="Other">,</span> <span class="StringLit">"rp"</span><span class="Other">,</span> <span class="StringLit">"rt"</span><span class="Other">,</span> <span class="StringLit">"ruby"</span><span class="Other">,</span>
- <span class="StringLit">"s"</span><span class="Other">,</span> <span class="StringLit">"samp"</span><span class="Other">,</span> <span class="StringLit">"script"</span><span class="Other">,</span> <span class="StringLit">"section"</span><span class="Other">,</span> <span class="StringLit">"select"</span><span class="Other">,</span> <span class="StringLit">"small"</span><span class="Other">,</span> <span class="StringLit">"source"</span><span class="Other">,</span>
- <span class="StringLit">"span"</span><span class="Other">,</span> <span class="StringLit">"strike"</span><span class="Other">,</span> <span class="StringLit">"strong"</span><span class="Other">,</span> <span class="StringLit">"style"</span><span class="Other">,</span> <span class="StringLit">"sub"</span><span class="Other">,</span> <span class="StringLit">"summary"</span><span class="Other">,</span> <span class="StringLit">"sup"</span><span class="Other">,</span>
- <span class="StringLit">"table"</span><span class="Other">,</span> <span class="StringLit">"tbody"</span><span class="Other">,</span> <span class="StringLit">"td"</span><span class="Other">,</span> <span class="StringLit">"textarea"</span><span class="Other">,</span> <span class="StringLit">"tfoot"</span><span class="Other">,</span> <span class="StringLit">"th"</span><span class="Other">,</span> <span class="StringLit">"thead"</span><span class="Other">,</span> <span class="StringLit">"time"</span><span class="Other">,</span>
- <span class="StringLit">"title"</span><span class="Other">,</span> <span class="StringLit">"tr"</span><span class="Other">,</span> <span class="StringLit">"track"</span><span class="Other">,</span> <span class="StringLit">"tt"</span><span class="Other">,</span> <span class="StringLit">"u"</span><span class="Other">,</span> <span class="StringLit">"ul"</span><span class="Other">,</span> <span class="StringLit">"var"</span><span class="Other">,</span> <span class="StringLit">"video"</span><span class="Other">,</span> <span class="StringLit">"wbr"</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">&</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">&</span><span class="Comment">#220;</span></span></tt> or <tt class="docutils literal"><span class="pre"><span class="Operator">&</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">""</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">"a"</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">"gt"</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">">"</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">"Uuml"</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">"Ü"</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">"quest"</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">"?"</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">"#x0003F"</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">"?"</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">&</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">&</span><span class="Comment">#220;</span></span></tt> or <tt class="docutils literal"><span class="pre"><span class="Operator">&</span><span class="Comment">#x000DC;</span></span></tt> to its UTF-8 equivalent. "" 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">"Σ"</span>
- <span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">""</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">""</span>
- <span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">"a"</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">""</span>
- <span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">"gt"</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">">"</span>
- <span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">"Uuml"</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">"Ü"</span>
- <span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">"quest"</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">"?"</span>
- <span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">"#63"</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">"?"</span>
- <span class="Identifier">doAssert</span> <span class="Identifier">entityToUtf8</span><span class="Punctuation">(</span><span class="StringLit">"Sigma"</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">"#931"</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">"#0931"</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">"#x3A3"</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">"#x03A3"</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">"#x3a3"</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">"#X3a3"</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">""</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">""</span>
- <span class="Identifier">doAssert</span> <span class="Identifier">runeToEntity</span><span class="Punctuation">(</span><span class="StringLit">"Ü"</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">"#220"</span>
- <span class="Identifier">doAssert</span> <span class="Identifier">runeToEntity</span><span class="Punctuation">(</span><span class="StringLit">"∈"</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">"#8712"</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-02-03 14:57:41 UTC</small>
- </div>
- </div>
- </div>
- <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
-
- </body>
- </html>
|