3 ms·
Interesting, but you would still have to account for the inconsistencies of html, like: - Standalone, non-closed tags <!doctype>, <hr>, <br>, <link>, <meta>, <
by tyingq 10y ago
Interesting, but you would still have to account for the inconsistencies of html, like:
- Standalone, non-closed tags <!doctype>, <hr>, <br>, <link>, <meta>, <img> etc.
- Proper encoding or quoting of [< > " ' &] in html attributes
- <script> tags and CDATA
Probably lots more as well. Not rocket science of course, but you would want a tool where you have some confidence they've covered all of these things.
- recursive 10y agoLast time I looked <textarea> and <pre> also worked kind of like <script>.
- minitech 10y ago<pre> doesn’t at all. At a stretch, maybe you’re thinking of <xmp>?
- lisper 10y ago> Not rocket science of course And it depends on whether you're parsing or rendering. Rendering is much easier than parsing. But even parsing is nonetheless a solved problem :-)
- dqv 10y agoFor anyone interested, things are close, they just need to be glued: In guile, (htmlprag) addresses the import[1]. It handles "weird html". The SXML modules[2] can handle encoding and rendering. CDATA is the only thing (that seems to be) missing. I'll have to look into that. Someone also made a module to render html[3]. [1]http://www.nongnu.org/guile-lib/doc/ref/htmlprag/ http://www.nongnu.org/guile-lib/doc/ref/htmlprag/ [2]https://www.gnu.org/software/guile/manual/guile.html#SXML https://www.gnu.org/software/guile/manual/guile.html#SXML [3]https://dthompson.us/rendering-html-with-sxml-and-gnu-guile.html https://dthompson.us/rendering-html-with-sxml-and-gnu-guile....