2 users online. Create an account or sign in to join them.Users
HTML5 Doctype
This is an open discussion with 9 replies, filed under Extensions.
Search
Hi Stephen,
Thanks for this.
While this topic title is clear your description had me confused. This extension is simply the post-processed HTML5 doctype, right?
What your extension does is swap out the first n of lines from the processed XSLT and replace the Doctype/Charset with its HTML5 equivalent. There are a couple variations of this extension floating around.
You seem to suggest in your description, though, that you've continued work on Nick's post-processing extension. Nick's extension was not about the Doctype, perse, but was about post-processing the complete HTML and re-indent it properly (right Nick?).
I am asking because this remains a bit of a frustration as I've mentioned before.
Just to be sure: are not trying to tackle the 'indentation' problem but only replacing the default XHTML Doctype for the HTML5 one?
Yes, this is the post-processed HTML5 doctype. I've tried to clarify what this extension does by adding an explanation of the usage to the extension description.
I have been using this extension in production since the beginning of the year and it has been working quite well. You can see the nicely indented output on our site.
Thanks Stephen, that's what I meant. I have been using (a variation of) this extension too, for quite some time and it works well.
Basically you have Symphony output a XHTML page that get's transformed to HTML5 with the XHTML syntax. Because the output-method="xml" the indentation is preserved.
The issue remains that it's not possible to output properly indented HTML syntax at the moment. You kinda got my hopes up for a moment ;)
Are you referring to the closing of void elements, such as script and textarea?
If so, the proper closing of elements is being preserved because the XHTML doctype is being declared as well as output-method="xml".
See the script elements at the bottom of the page. They are being properly treated as void elements.
Nope, I was referring to the fact that this extension (still) requires a XHTML syntax (through output="xml"). It works fine that way (no issues with textarea or script, etc.) because you post-parse the default XHTML doctype and use output="xml"
The main issue re: void elements simply seems to be the Doctype: use output="xml" together with anything but the XHTML Doctype (such as the legacy-compat one) and you'll run into trouble.
These troubles are obviously worked around by post-parsing the Doctype so that's fine.
My current thinking, however, is that I'd prefer the output="html" output for HTML documents ;) And this breaks indentation. Which annoys me (OCD maybe, but then again: view-source should be important to any front-end developer :) )
In short: mostly ignore my ramblings. This is a nice <del>hack</del><ins>extension</ins> to allow us to use the HTML5 doctype with XHTML syntax and proper indenting.
HTML syntax and proper indenting remains impossible(?) but that has nothing to do with this extension and is probably only annoying for very picky people such as myself :)
Thanks for clarifying. I agree that this hack should not be necessary. But it seems it will need to be available as a possible workaround until the XSLT processor used by PHP is updated to properly output HTML5.
@bauhouse, has something happened to the Github repository? The extension shows as 1.2.5 (4 Nov) here at the Symphony extension page, but at the Github repo it only seems to have the commits for 1.2.4 (3 Mar).
I have the extension cloned in one Symphony install, which includes the 1.2.5 commits, and it tells me I'm ahead of the master branch:
$ git status # On branch master # Your branch is ahead of 'origin/master' by 5 commits.
1.2.4 has:
$html_array = explode("n", $html, 5);
1.2.5 (including my repo which is "ahead") has:
$html_array = explode("n", $html, 15);
Umm. Yeah. Thanks for noting that.
Sorry about that, David (and anyone else who might have been using this repository). I actually lost track of which of my repositories was the master when I deleted the old repository and pushed it back up to GitHub (which is what Nick and I agreed to do to make me the official maintainer of the extension). So, the domain7 repository is no longer a fork. But I pushed from an old repo instead of the latest.
If anyone has any conflicts with pulling the git repository, you may have to force it:
git pull -f origin master
Note the -f flag to force the pull to overwrite the local history for the master branch.
My bad.
I just started to modify the extension to include the extension.meta.xml file, as recommended by the Migration Guide for Symphony 2.3. But I mistakenly added it to an older version of the repo.
Aha - thanks a lot for the info and -f tip.
Create an account or sign in to comment.
A new extension, "HTML5 Doctype" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.