HTML5 Doctype
This is an open discussion with 29 replies, filed under Extensions.
Search
@cotiunix - you might want to look at a previous post in this thread. With your xslt utility you created you will run into problems with textarea
and script
.
Also, you might want to look over this older thread as well. It's really helpful.
merde! why, can't it be the default behavior
why, can't it be the default behavior
@cotiunix - set your output="html"
and that should fix your problem.
@bzerangue, that is breaking the indented output.
@cotiunix - that's one of the reasons why the HTML5 Doctype Extension was created. XSLT 1.0 output="html"
breaks the indent, and output="xml"
outputs xml... but HTML5 is not strict and basically ignores all XML rules.
Is there a problem with using the extension?
there is no problem, but a core edit with this behaviour as default, would save time and resources.
@constantin +1 :)
Just stumbled into here, noticed you reference my gist https://gist.github.com/nathanhornby/4575744.
@cotiunix
What breaks? I use it for all my projects, haven't noticed anything wrong in the most recent iteration - if you could let me know I'd appreciate it! Feel free to edit the gist directly.
Edit: Sorry I looked straight past your typo - it breaks the indenting. That's not an issue for me as I always minify the production code and use inspectors during development - however if there's an easy change that fixes it I'd be happy to add it in - if there's no easy workaround I'll remove the indent="yes"
declaration so it's at least clear it shouldn't be indenting.
@cotiunix I have long since got rid of this extension and simply use the following code in my master.xsl
(someone here in the forum came up with this, can’t remember who though):
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="UTF-8" indent="no" /> <xsl:template match="/"> <xsl:text disable-output-escaping="yes"><</xsl:text>!DOCTYPE html<xsl:text disable-output-escaping="yes">></xsl:text> <html lang="de"> <…>
Create an account or sign in to comment.
Found this gist https://gist.github.com/nathanhornby/4575744 but it breaks intending
post edit
I also created a more cleaner version, https://gist.github.com/cmnstmntmn/799440acb5c746dc3a1a, so html doctype extension is no longer needed.