News for hackers. Stuff that matters.
Re:Foolproof HTML by tyingq on Saturday February 04, 2017 @08:27PM (#13570222)
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.

Re:Foolproof HTML by dqv on Sunday February 05, 2017 @04:02AM (#13571555)
For 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/

[2]https://www.gnu.org/software/guile/manual/guile.html#SXML

[3]https://dthompson.us/rendering-html-with-sxml-and-gnu-guile....

Re:Foolproof HTML by lisper on Sunday February 05, 2017 @02:13AM (#13571327)
> 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 :-)

Re:Foolproof HTML by recursive on Saturday February 04, 2017 @10:37PM (#13570700)
Last time I looked <textarea> and <pre> also worked kind of like <script>.
Re:Foolproof HTML by minitech on Sunday February 05, 2017 @06:18AM (#13571868)
<pre> doesn’t at all. At a stretch, maybe you’re thinking of <xmp>?