4 ms·
One and only one of each. And having more than 1 doctype declaration is ridiculous. Browsers are very resistent to garbage markup, so by looking at the parsed t
by franga2000 8y ago
One and only one of each. And having more than 1 doctype declaration is ridiculous.
Browsers are very resistent to garbage markup, so by looking at the parsed tree and not the raw text, I never actually noticed that.
I have no idea why they would do that. It looks like a misconfigurated preprocessor that thinks each fragment is a doc of its own. I vaguely recall something about them open-sourcing the frontend, so I might look into that...
- azangru 8y agoYep, my guess would be that they are using a markdown parser that generates a complete html document out of submitted markdown, and then they just stitch those parsed htmls together, like here (the processed_html method on the article instance): https://github.com/thepracticaldev/dev.to/blob/master/app/views/articles/show.html.erb#L165 https://github.com/thepracticaldev/dev.to/blob/master/app/vi... > Browsers are very resistent to garbage markup Miraculously so! Anything I would have attempted to design would have crapped its pants at the look of this markup, but browsers heroically manage to display it as if nothing weird is happening. I take my hat off to their resilience.
- bhalp1 8y agoYes. And actually, this is a mistake in our processing configuration. We don’t want separate body tags, but it hasn’t been a problem so we haven’t gotten around to fixing it. PRs welcome. :)