|
From: <fg...@us...> - 2010-12-05 09:40:23
|
Revision: 1258
http://jtidy.svn.sourceforge.net/jtidy/?rev=1258&view=rev
Author: fgiust
Date: 2010-12-05 09:40:17 +0000 (Sun, 05 Dec 2010)
Log Message:
-----------
fix for 538727 user doctype ignored when not in xhtml mode (looks broken also in tidy c)
Modified Paths:
--------------
branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java
Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java
===================================================================
--- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-12-05 08:16:33 UTC (rev 1257)
+++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-12-05 09:40:17 UTC (rev 1258)
@@ -1325,6 +1325,26 @@
if (configuration.isXmlOut()) {
return true;
}
+
+ // fgiust: missing in Tidy c, custom doctype only works in xhtml mode (when setXhtmlDocType is called)
+ // see test 538727
+ if (dtmode == DoctypeModes.User && this.configuration.getDocTypeStr() != null
+ && this.configuration.getDocTypeStr().length() > 0) {
+ final String pub = "PUBLIC";
+ doctype = newDocTypeNode(root);
+ doctype.element = "html";
+
+ String docTypeStringFixed = this.configuration.getDocTypeStr();
+ // check if the fpi is quoted or not
+ if (docTypeStringFixed.charAt(0) == '"')
+ {
+ docTypeStringFixed = docTypeStringFixed.substring(1, docTypeStringFixed.length() -1);
+ }
+
+ doctype.repairAttrValue(pub, docTypeStringFixed);
+ }
+ //
+
if (doctype != null) {
hadSI = doctype.getAttrByName("SYSTEM") != null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|