I've been cleaning up a few modules and now nearly everything is validated XHTML1.1 compliant. Yee haw!!!
But, what I can't get to validate is a lot of user-submitted HTML, such as news, reviews, etc.
Anybody know of anything out there that users could use to validate their HTML before allowing them to submit? Perhaps we could run their "preview" through the W3 validator....any ideas?
Slugger
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
HTML Validator
-
- Rank: Expert
- Registered: Mar 11, 2003
- Last visit: Oct 21, 2009
- Posts: 1104
-
- Rank: Software Foundation
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 3814
http://tidy.sourceforge.net/
- if using XHTML do you use the appropriate mime type 'application/xhtml+xml), too [1]?
- did you check your site with a 'schema-validator' [2]
(BTW: i've just ported both krapohl.info and PN-cms.de to XHTML 1.0 strict under application/xhtml+xml for QA of postnuke .76
)
[1] http://www.hixie.ch/advocacy/xhtml
[2] http://www.schneegans.de/sv
--
regards from germany
..::[Zikula Application Framework]::.. ..::[SEO-Blog]::.. ..::[CMS Sicherheit]::.. -
- Rank: Expert
- Registered: Mar 11, 2003
- Last visit: Oct 21, 2009
- Posts: 1104
Talk about stealing one's thunder! :?
Thanks for the tidy reference...now the question is how do I get it to work with my PN submissions???? Are you using it?
As for mime, I found this:
Code
$charset = "iso-8859-1";
$mime = "text/html";
function fix_code($buffer) {
return (preg_replace("!\s*/>!", ">", $buffer));
}
if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
if(preg_match("/application\/xhtml\+xml;q=([01]|0\.\d{1,3}|1\.0)/i",$_SERVER["HTTP_ACCEPT"],$matches)) {
$xhtml_q = $matches[1];
if(preg_match("/text\/html;q=q=([01]|0\.\d{1,3}|1\.0)/i",$_SERVER["HTTP_ACCEPT"],$matches)) {
$html_q = $matches[1];
if((float)$xhtml_q >= (float)$html_q) {
$mime = "application/xhtml+xml";
}
}
} else {
$mime = "application/xhtml+xml";
}
}
if($mime == "application/xhtml+xml") {
$prolog_type = "<?xml version=\"1.0\" encoding=\"$charset\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
} else {
ob_start("fix_code");
$prolog_type = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html lang=\"en\">\n";
}
header("Content-Type: $mime;charset=$charset");
header("Vary: Accept");
print $prolog_type;
...and no, I couldn't get the schema-validated under 1.1 (not supported) but I have as 1.0. Thanks for the reference.
I wasn't able to validate krapohl.info or PN-cms.de either so I guess I shouldn't feel too bad.
Still, it's not surprising to learn that you're way out ahead of me on this....but, as you did when you introduced PN-cms.de without tables, you've given me incentive to keep going at it. (BTW info I've pulled from the forums at PN-cms.de has been a "life saver" on more than one occasion.)
Finally, I'd like to say how grateful I am to everyone (particularly Mark and you) who cleaned up the core to the point that this exercise is even possible. :)
Slugger -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
one of youz guyz should develop that into a hook-module that can pass through the 'preview' stage of submit story... -
- Rank: Software Foundation
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 3814
Quote
As for mime, I found this:
[...]
i use a quite similiar snippet as a theme plugin to set the correct mime type for the 'advanced' browsers (IE still can display XHTML), see http://www.pn-cms.de/themes/pnMain/plugins/function.contenttype.php.txt (still some work to do). there's a minor problem within administration due to not 'well-formed' links in an admin-template that can't be overridden with a theme template due to include paths but this is already on the list...
Quote
I wasn't able to validate krapohl.info or PN-cms.de either so I guess I shouldn't feel too bad.
due to various accessibility reasons (e.g. deprecated lang attribute) i stick with XHTML 1.0:
schema validation for krapohl.info
schema validation for pn-cms.de
Quote
one of youz guyz should develop that into a hook-module that can pass through the 'preview' stage of submit story...
already thought of something like this but i didn't find a tidy-(PHP)-class yet. it's one of the basic parts for an atag compliant CMS...
--
regards from germany
..::[Zikula Application Framework]::.. ..::[SEO-Blog]::.. ..::[CMS Sicherheit]::.. -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
Thanks larsneo, I needed that plugin! ;)
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Expert
- Registered: Mar 11, 2003
- Last visit: Oct 21, 2009
- Posts: 1104
- Moderated by:
- Support
