2 ms·
Re "SVG-only" at the end, an example was reposted just a few days ago: https://news.ycombinator.com/item?id=45240391 https://news.ycombinator.com/item?id=452403
by o11c 1y ago
Re "SVG-only" at the end, an example was reposted just a few days ago: https://news.ycombinator.com/item?id=45240391 https://news.ycombinator.com/item?id=45240391
One really nasty thing I've encountered when scraping old webpages:
<p>
Hello, <i>World
</p>
<!--
And then the server decides to insert a pagination point
in the middle of this multi-paragraph thought-quote or whatever.
-->
<p>
Goodbye,</i> Moon
</p>
XHTML really isn't hard (try it: just change your mime type (often, just rename your files), add the xmlns and then doing a scream test - mostly, self-close your tags, make sure your scripts/stylesheets are separate files, but also don't rely on implicit `<tbody>` or anything), people really should use it more. I do admit I like HTML for hand-writing things like tables, but they should be transformed before publishing.
Now, if only there were a sane way to do CSS ... currently, it's prone to the old "truncated download is indistinguishable from correct EOF" flaw if you aren't using chunking. You can sort of fix this by having the last rule in the file be `#no-css {display:none;}` but that scales poorly if you have multiple non-alternate stylesheets, unless I'm missing something.
(MJS is not sane in quite a few ways, but at least it doesn't have this degree of problems)
- smj-edison 1y agoWait, is this why pages will randomly fail to load CSS? It's happened a couple times even on a stable connection, but it works after reloading.
- o11c 1y agoIf it fails to load the CSS entirely, it's not this, just general network problems. Truncation "shouldn't" be common, because chunking is very common for mainstream web servers (and clients of course). And TLS is supposed to explicit protect against this regardless of HTTP. OTOH, especially behind proxies there are a lot of very minimal HTTP implementations. And, for one reason or another, it is fairly common to visibly see truncation for images and occasionally for HTML too.
- kevincox 1y agoI would use XHTML but IIUC no browser have streaming XHTML parsers so the performance is much worse than the horror of HTML. And now that HTML is strictly specified it is complex to get your emitter working correctly (example: you need to know which tags are self closing to properly serialize HTML) but once you do a good job it just works.