You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(46) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
(15) |
Aug
(24) |
Sep
(14) |
Oct
(2) |
Nov
(1) |
Dec
(18) |
2002 |
Jan
(12) |
Feb
(5) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(10) |
Jul
(3) |
Aug
(4) |
Sep
|
Oct
(1) |
Nov
|
Dec
(5) |
2003 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(4) |
Jul
(2) |
Aug
(4) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2004 |
Jan
(141) |
Feb
(79) |
Mar
(85) |
Apr
(38) |
May
(1) |
Jun
|
Jul
(78) |
Aug
(223) |
Sep
(107) |
Oct
(158) |
Nov
(136) |
Dec
|
2005 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(100) |
Dec
(22) |
From: <ad...@us...> - 2010-11-13 20:45:04
|
Revision: 1186 http://jtidy.svn.sourceforge.net/jtidy/?rev=1186&view=rev Author: aditsu Date: 2010-11-13 20:44:58 +0000 (Sat, 13 Nov 2010) Log Message: ----------- rearranged cases in the warning method to match the C code Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-13 20:18:23 UTC (rev 1185) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-13 20:44:58 UTC (rev 1186) @@ -692,58 +692,23 @@ } switch (code) { - case MISSING_ENDTAG_FOR : - messageNode(lexer, Level.WARNING, rpt, code, element.element); + case NESTED_QUOTATION : + messageNode(lexer, Level.WARNING, rpt, code); break; - case MISSING_ENDTAG_BEFORE : - messageNode(lexer, Level.WARNING, rpt, code, element.element, nodedesc); + case OBSOLETE_ELEMENT : + messageLexer(lexer, Level.WARNING, code, getTagName(element), getTagName(node)); break; - case DISCARDING_UNEXPECTED : - if (lexer.badForm == 0) - { - // the case for when this is an error not a warning, is handled later - messageLexer( - lexer, - Level.WARNING, - code, - getTagName(node)); - } - break; - case NESTED_EMPHASIS : messageLexer(lexer, Level.INFO, code, getTagName(node)); break; - case COERCE_TO_ENDTAG : - messageNode(lexer, Level.WARNING, rpt, code, element.element); - break; - - case NON_MATCHING_ENDTAG : - messageLexer( - lexer, - Level.WARNING, - code, - getTagName(node), element.element); - break; - - case TAG_NOT_ALLOWED_IN : - messageNode(lexer, Level.WARNING, node, code, nodedesc, element.element); - if (lexer.configuration.isShowWarnings()) { - messageNode(lexer, Level.INFO, element, PREVIOUS_LOCATION, element.element); - } - break; - - case DOCTYPE_AFTER_TAGS : - messageLexer(lexer, Level.WARNING, code); - break; - case MISSING_STARTTAG : case UNEXPECTED_ENDTAG : case TOO_MANY_ELEMENTS : case INSERTING_TAG : - messageNode(lexer, Level.WARNING, node, code, node.element); + messageNode(lexer, Level.WARNING, node, code, node.element); break; case USING_BR_INPLACE_OF : @@ -752,24 +717,10 @@ messageNode(lexer, Level.WARNING, node, code, nodedesc); break; - case OBSOLETE_ELEMENT : - messageLexer(lexer, Level.WARNING, code, - getTagName(element), - getTagName(node)); - break; - case UNESCAPED_ELEMENT : messageLexer(lexer, Level.WARNING, code, getTagName(element)); break; - case TRIM_EMPTY_ELEMENT : - messageNode(lexer, Level.WARNING, element, code, getTagName(element)); - break; - - case ILLEGAL_NESTING : - messageLexer(lexer, Level.WARNING, code, getTagName(element)); - break; - case NOFRAMES_CONTENT : messageLexer(lexer, Level.WARNING, code, getTagName(node)); break; @@ -787,30 +738,64 @@ messageNode(lexer, Level.WARNING, rpt, code); break; + case DOCTYPE_AFTER_TAGS : + messageLexer(lexer, Level.WARNING, code); + break; + + case COERCE_TO_ENDTAG : + messageNode(lexer, Level.WARNING, rpt, code, element.element); + break; + + case NON_MATCHING_ENDTAG : + messageLexer(lexer, Level.WARNING, code, getTagName(node), element.element); + break; + + case MISSING_DOCTYPE: + case SPACE_PRECEDING_XMLDECL: + messageLexer(lexer, Level.WARNING, code); + break; + + case TRIM_EMPTY_ELEMENT : + messageNode(lexer, Level.WARNING, element, code, getTagName(element)); + break; + + case ILLEGAL_NESTING : + messageLexer(lexer, Level.WARNING, code, getTagName(element)); + break; + case UNEXPECTED_END_OF_FILE : // on end of file adjust reported position to end of input lexer.lines = lexer.in.getCurline(); lexer.columns = lexer.in.getCurcol(); - messageLexer( - lexer, - Level.WARNING, - code, - getTagName(element)); + messageLexer(lexer, Level.WARNING, code, getTagName(element)); break; - case NESTED_QUOTATION : - messageNode(lexer, Level.WARNING, rpt, code); - break; - case ELEMENT_NOT_EMPTY : messageLexer(lexer, Level.WARNING, code, getTagName(element)); break; - case MISSING_DOCTYPE: - case SPACE_PRECEDING_XMLDECL: - messageLexer(lexer, Level.WARNING, code); + case MISSING_ENDTAG_FOR : + messageNode(lexer, Level.WARNING, rpt, code, element.element); break; - + + case MISSING_ENDTAG_BEFORE : + messageNode(lexer, Level.WARNING, rpt, code, element.element, nodedesc); + break; + + case DISCARDING_UNEXPECTED : + if (lexer.badForm == 0) { + // the case for when this is an error not a warning, is handled later + messageLexer(lexer, Level.WARNING, code, getTagName(node)); + } + break; + + case TAG_NOT_ALLOWED_IN : + messageNode(lexer, Level.WARNING, node, code, nodedesc, element.element); + if (lexer.configuration.isShowWarnings()) { + messageNode(lexer, Level.INFO, element, PREVIOUS_LOCATION, element.element); + } + break; + case REPLACING_ELEMENT: case REPLACING_UNEX_ELEMENT: messageNode(lexer, Level.WARNING, rpt, code, getTagName(element), nodedesc); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-13 20:18:29
|
Revision: 1185 http://jtidy.svn.sourceforge.net/jtidy/?rev=1185&view=rev Author: aditsu Date: 2010-11-13 20:18:23 +0000 (Sat, 13 Nov 2010) Log Message: ----------- fixed test 655338 - added checks for xml declaration, and SPACE_PRECEDING_XMLDECL message Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-11-13 19:56:05 UTC (rev 1184) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-11-13 20:18:23 UTC (rev 1185) @@ -3813,4 +3813,12 @@ report.error(this, null, null, ErrorCode.MALFORMED_DOCTYPE); return null; } + + public Node findXmlDecl() { + Node node = root.content; + while (node != null && node.type != NodeType.XmlDecl) { + node = node.next; + } + return node; + } } Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-13 19:56:05 UTC (rev 1184) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-13 20:18:23 UTC (rev 1185) @@ -3503,6 +3503,16 @@ while ((node = lexer.getToken(Lexer.IGNORE_WHITESPACE)) != null) { + if (node.type == NodeType.XmlDecl) { + if (lexer.findXmlDecl() != null && lexer.root.content != null) { + lexer.report.warning(lexer, lexer.root, node, ErrorCode.DISCARDING_UNEXPECTED); + continue; + } + if (node.line != 1 || node.column != 1) { + lexer.report.warning(lexer, lexer.root, node, ErrorCode.SPACE_PRECEDING_XMLDECL); + } + } + // deal with comments etc. if (Node.insertMisc(document, node)) { Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-13 19:56:05 UTC (rev 1184) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-13 20:18:23 UTC (rev 1185) @@ -806,7 +806,8 @@ messageLexer(lexer, Level.WARNING, code, getTagName(element)); break; - case MISSING_DOCTYPE : + case MISSING_DOCTYPE: + case SPACE_PRECEDING_XMLDECL: messageLexer(lexer, Level.WARNING, code); break; Modified: branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties =================================================================== --- branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-13 19:56:05 UTC (rev 1184) +++ branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-13 20:18:23 UTC (rev 1185) @@ -97,6 +97,7 @@ replacing_unex_element=replacing unexpected {0} by {1} report_version=Document content looks like {0} slides_found={0,number} Slides found +space_preceding_xmldecl = removing whitespace preceding XML Declaration suspected_missing_quote=missing quotemark for attribute value tag_not_allowed_in={0} isn''t allowed in <{1}> elements too_many_elements=too many {0} elements This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-13 19:56:12
|
Revision: 1184 http://jtidy.svn.sourceforge.net/jtidy/?rev=1184&view=rev Author: aditsu Date: 2010-11-13 19:56:05 +0000 (Sat, 13 Nov 2010) Log Message: ----------- fixed test 1715153 - added BAD_ATTRIBUTE_VALUE_REPLACED Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-07 17:42:05 UTC (rev 1183) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-13 19:56:05 UTC (rev 1184) @@ -578,7 +578,8 @@ lexer.badAccess |= MISSING_IMAGE_MAP; break; - case BAD_ATTRIBUTE_VALUE : + case BAD_ATTRIBUTE_VALUE: + case BAD_ATTRIBUTE_VALUE_REPLACED: case INVALID_ATTRIBUTE: messageNode(lexer, Level.WARNING, node, code, tagdesc, name, value); break; Modified: branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties =================================================================== --- branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-07 17:42:05 UTC (rev 1183) +++ branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-13 19:56:05 UTC (rev 1184) @@ -5,6 +5,7 @@ backslash_in_uri={0} URI reference contains backslash. Typo? bad_argument=Warning - missing or malformed argument "{1}" for option "{0}" bad_attribute_value={0} attribute "{1}" has invalid value "{2}" +bad_attribute_value_replaced = {0} attribute "{1}" had invalid value "{2}" and has been replaced bad_cdata_content=''<'' + ''/'' + letter not allowed here bad_comment_chars=expecting -- or > bad_tree=Panic - tree has lost its integrity This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-07 17:42:11
|
Revision: 1183 http://jtidy.svn.sourceforge.net/jtidy/?rev=1183&view=rev Author: aditsu Date: 2010-11-07 17:42:05 +0000 (Sun, 07 Nov 2010) Log Message: ----------- fixed test 443362 - discard nodes with null tag in ParsePre Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-07 17:19:38 UTC (rev 1182) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-07 17:42:05 UTC (rev 1183) @@ -1942,6 +1942,11 @@ { continue; } + + if (node.tag == null) { + lexer.report.warning(lexer, pre, node, ErrorCode.DISCARDING_UNEXPECTED); + continue; + } // strip unexpected tags if (!lexer.preContent(node)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-07 17:19:44
|
Revision: 1182 http://jtidy.svn.sourceforge.net/jtidy/?rev=1182&view=rev Author: aditsu Date: 2010-11-07 17:19:38 +0000 (Sun, 07 Nov 2010) Log Message: ----------- fixed test 473490 - process warnings even if showWarnings is false, to update the count Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-07 17:03:12 UTC (rev 1181) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-07 17:19:38 UTC (rev 1182) @@ -690,136 +690,132 @@ return; } - if (lexer.configuration.isShowWarnings()) - { - switch (code) - { - case MISSING_ENDTAG_FOR : - messageNode(lexer, Level.WARNING, rpt, code, element.element); - break; + switch (code) { + case MISSING_ENDTAG_FOR : + messageNode(lexer, Level.WARNING, rpt, code, element.element); + break; - case MISSING_ENDTAG_BEFORE : - messageNode(lexer, Level.WARNING, rpt, code, element.element, nodedesc); - break; + case MISSING_ENDTAG_BEFORE : + messageNode(lexer, Level.WARNING, rpt, code, element.element, nodedesc); + break; - case DISCARDING_UNEXPECTED : - if (lexer.badForm == 0) - { - // the case for when this is an error not a warning, is handled later - messageLexer( - lexer, - Level.WARNING, - code, - getTagName(node)); - } - break; - - case NESTED_EMPHASIS : - messageLexer(lexer, Level.INFO, code, getTagName(node)); - break; - - case COERCE_TO_ENDTAG : - messageNode(lexer, Level.WARNING, rpt, code, element.element); - break; - - case NON_MATCHING_ENDTAG : + case DISCARDING_UNEXPECTED : + if (lexer.badForm == 0) + { + // the case for when this is an error not a warning, is handled later messageLexer( lexer, Level.WARNING, code, - getTagName(node), element.element); - break; + getTagName(node)); + } + break; - case TAG_NOT_ALLOWED_IN : - messageNode(lexer, Level.WARNING, node, code, nodedesc, element.element); - if (lexer.configuration.isShowWarnings()) { - messageNode(lexer, Level.INFO, element, PREVIOUS_LOCATION, element.element); - } - break; + case NESTED_EMPHASIS : + messageLexer(lexer, Level.INFO, code, getTagName(node)); + break; - case DOCTYPE_AFTER_TAGS : - messageLexer(lexer, Level.WARNING, code); - break; + case COERCE_TO_ENDTAG : + messageNode(lexer, Level.WARNING, rpt, code, element.element); + break; - case MISSING_STARTTAG : - case UNEXPECTED_ENDTAG : - case TOO_MANY_ELEMENTS : - case INSERTING_TAG : - messageNode(lexer, Level.WARNING, node, code, node.element); - break; + case NON_MATCHING_ENDTAG : + messageLexer( + lexer, + Level.WARNING, + code, + getTagName(node), element.element); + break; - case USING_BR_INPLACE_OF : - case CANT_BE_NESTED : - case PROPRIETARY_ELEMENT : - messageNode(lexer, Level.WARNING, node, code, nodedesc); - break; + case TAG_NOT_ALLOWED_IN : + messageNode(lexer, Level.WARNING, node, code, nodedesc, element.element); + if (lexer.configuration.isShowWarnings()) { + messageNode(lexer, Level.INFO, element, PREVIOUS_LOCATION, element.element); + } + break; - case OBSOLETE_ELEMENT : - messageLexer(lexer, Level.WARNING, code, - getTagName(element), - getTagName(node)); - break; + case DOCTYPE_AFTER_TAGS : + messageLexer(lexer, Level.WARNING, code); + break; - case UNESCAPED_ELEMENT : - messageLexer(lexer, Level.WARNING, code, getTagName(element)); - break; + case MISSING_STARTTAG : + case UNEXPECTED_ENDTAG : + case TOO_MANY_ELEMENTS : + case INSERTING_TAG : + messageNode(lexer, Level.WARNING, node, code, node.element); + break; - case TRIM_EMPTY_ELEMENT : - messageNode(lexer, Level.WARNING, element, code, getTagName(element)); - break; + case USING_BR_INPLACE_OF : + case CANT_BE_NESTED : + case PROPRIETARY_ELEMENT : + messageNode(lexer, Level.WARNING, node, code, nodedesc); + break; - case ILLEGAL_NESTING : - messageLexer(lexer, Level.WARNING, code, getTagName(element)); - break; + case OBSOLETE_ELEMENT : + messageLexer(lexer, Level.WARNING, code, + getTagName(element), + getTagName(node)); + break; - case NOFRAMES_CONTENT : - messageLexer(lexer, Level.WARNING, code, getTagName(node)); - break; + case UNESCAPED_ELEMENT : + messageLexer(lexer, Level.WARNING, code, getTagName(element)); + break; - case MISSING_TITLE_ELEMENT : - case INCONSISTENT_VERSION : - case MALFORMED_DOCTYPE : - case CONTENT_AFTER_BODY : - case MALFORMED_COMMENT : - case BAD_COMMENT_CHARS : - case BAD_XML_COMMENT : - case BAD_CDATA_CONTENT : - case INCONSISTENT_NAMESPACE : - case DTYPE_NOT_UPPER_CASE : - messageNode(lexer, Level.WARNING, rpt, code); - break; + case TRIM_EMPTY_ELEMENT : + messageNode(lexer, Level.WARNING, element, code, getTagName(element)); + break; - case UNEXPECTED_END_OF_FILE : - // on end of file adjust reported position to end of input - lexer.lines = lexer.in.getCurline(); - lexer.columns = lexer.in.getCurcol(); - messageLexer( - lexer, - Level.WARNING, - code, - getTagName(element)); - break; + case ILLEGAL_NESTING : + messageLexer(lexer, Level.WARNING, code, getTagName(element)); + break; - case NESTED_QUOTATION : - messageNode(lexer, Level.WARNING, rpt, code); - break; + case NOFRAMES_CONTENT : + messageLexer(lexer, Level.WARNING, code, getTagName(node)); + break; - case ELEMENT_NOT_EMPTY : - messageLexer(lexer, Level.WARNING, code, getTagName(element)); - break; + case MISSING_TITLE_ELEMENT : + case INCONSISTENT_VERSION : + case MALFORMED_DOCTYPE : + case CONTENT_AFTER_BODY : + case MALFORMED_COMMENT : + case BAD_COMMENT_CHARS : + case BAD_XML_COMMENT : + case BAD_CDATA_CONTENT : + case INCONSISTENT_NAMESPACE : + case DTYPE_NOT_UPPER_CASE : + messageNode(lexer, Level.WARNING, rpt, code); + break; - case MISSING_DOCTYPE : - messageLexer(lexer, Level.WARNING, code); - break; - - case REPLACING_ELEMENT: - case REPLACING_UNEX_ELEMENT: - messageNode(lexer, Level.WARNING, rpt, code, getTagName(element), nodedesc); - break; + case UNEXPECTED_END_OF_FILE : + // on end of file adjust reported position to end of input + lexer.lines = lexer.in.getCurline(); + lexer.columns = lexer.in.getCurcol(); + messageLexer( + lexer, + Level.WARNING, + code, + getTagName(element)); + break; - default : - break; - } + case NESTED_QUOTATION : + messageNode(lexer, Level.WARNING, rpt, code); + break; + + case ELEMENT_NOT_EMPTY : + messageLexer(lexer, Level.WARNING, code, getTagName(element)); + break; + + case MISSING_DOCTYPE : + messageLexer(lexer, Level.WARNING, code); + break; + + case REPLACING_ELEMENT: + case REPLACING_UNEX_ELEMENT: + messageNode(lexer, Level.WARNING, rpt, code, getTagName(element), nodedesc); + break; + + default : + break; } if ((code == DISCARDING_UNEXPECTED) && lexer.badForm != 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-07 17:03:18
|
Revision: 1181 http://jtidy.svn.sourceforge.net/jtidy/?rev=1181&view=rev Author: aditsu Date: 2010-11-07 17:03:12 +0000 (Sun, 07 Nov 2010) Log Message: ----------- fixed test 640473 - updated insertMisc to insert empty tags Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java 2010-11-07 14:59:33 UTC (rev 1180) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java 2010-11-07 17:03:12 UTC (rev 1181) @@ -1077,6 +1077,17 @@ return true; } } + + /* Declared empty tags seem to be slipping through + ** the cracks. This is an experiment to figure out + ** a decent place to pick them up. + */ + if (node.tag != null && node.isElement() && node.hasCM(Dict.CM_EMPTY) && node.is(TagId.UNKNOWN) + && (node.tag.versions & Versions.VERS_PROPRIETARY) != 0) { + element.insertNodeAtEnd(node); + return true; + } + return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-07 14:59:39
|
Revision: 1180 http://jtidy.svn.sourceforge.net/jtidy/?rev=1180&view=rev Author: aditsu Date: 2010-11-07 14:59:33 +0000 (Sun, 07 Nov 2010) Log Message: ----------- fixed test 655338 - updated insertMisc to insert xml declarations at the top Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java 2010-11-07 14:48:06 UTC (rev 1179) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java 2010-11-07 14:59:33 UTC (rev 1180) @@ -1055,21 +1055,28 @@ * @param node will be inserted at the end of element * @return <code>true</code> if the node has been inserted */ - public static boolean insertMisc(Node element, Node node) - { + public static boolean insertMisc(Node element, Node node) { if (node.type == NodeType.CommentTag - || node.type == NodeType.ProcInsTag - || node.type == NodeType.CDATATag - || node.type == NodeType.SectionTag - || node.type == NodeType.AspTag - || node.type == NodeType.JsteTag - || node.type == NodeType.PhpTag - || node.type == NodeType.XmlDecl) - { + || node.type == NodeType.ProcInsTag + || node.type == NodeType.CDATATag + || node.type == NodeType.SectionTag + || node.type == NodeType.AspTag + || node.type == NodeType.JsteTag + || node.type == NodeType.PhpTag) { element.insertNodeAtEnd(node); return true; } - + + if (node.type == NodeType.XmlDecl) { + Node root = element; + while (root != null && root.parent != null) { + root = root.parent; + } + if (root != null && !(root.content != null && root.content.type == NodeType.XmlDecl)) { + root.insertNodeAtStart(node); + return true; + } + } return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-07 14:48:14
|
Revision: 1179 http://jtidy.svn.sourceforge.net/jtidy/?rev=1179&view=rev Author: aditsu Date: 2010-11-07 14:48:06 +0000 (Sun, 07 Nov 2010) Log Message: ----------- fixed test 616744 - fixed ParseTagNames implementation Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParsePropertyImpl.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParsePropertyImpl.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParsePropertyImpl.java 2010-11-07 14:29:25 UTC (rev 1178) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParsePropertyImpl.java 2010-11-07 14:48:06 UTC (rev 1179) @@ -445,21 +445,21 @@ { short tagType = Dict.TAGTYPE_INLINE; - if ("new-inline-tags".equals(option)) - { - tagType = Dict.TAGTYPE_INLINE; - } - else if ("new-blocklevel-tags".equals(option)) - { + switch (option) { + case InlineTags: + tagType = Dict.TAGTYPE_INLINE; + break; + case BlockTags: tagType = Dict.TAGTYPE_BLOCK; - } - else if ("new-empty-tags".equals(option)) - { + break; + case EmptyTags: tagType = Dict.TAGTYPE_EMPTY; - } - else if ("new-pre-tags".equals(option)) - { + break; + case PreTags: tagType = Dict.TAGTYPE_PRE; + break; + default: + throw new IllegalArgumentException("Unexpected option: " + option); } StringTokenizer t = new StringTokenizer(value, " \t\n\r,"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-07 14:29:31
|
Revision: 1178 http://jtidy.svn.sourceforge.net/jtidy/?rev=1178&view=rev Author: aditsu Date: 2010-11-07 14:29:25 +0000 (Sun, 07 Nov 2010) Log Message: ----------- fixed test 443576 - use prefix matches for javascript tags' language attribute Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TagCheckImpl.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TagCheckImpl.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TagCheckImpl.java 2010-11-06 16:17:19 UTC (rev 1177) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TagCheckImpl.java 2010-11-07 14:29:25 UTC (rev 1178) @@ -210,8 +210,8 @@ if (lang != null) { String str = lang.value; - if ("javascript".equalsIgnoreCase(str) || "jscript".equalsIgnoreCase(str)) - { + if (str.regionMatches(true, 0, "javascript", 0, 10) || + str.regionMatches(true, 0, "jscript", 0, 7)) { node.addAttribute("type", "text/javascript"); } else if ("vbscript".equalsIgnoreCase(str)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 16:17:25
|
Revision: 1177 http://jtidy.svn.sourceforge.net/jtidy/?rev=1177&view=rev Author: aditsu Date: 2010-11-06 16:17:19 +0000 (Sat, 06 Nov 2010) Log Message: ----------- fixed test 511243 - only wrap after utf8 punctuation if the PunctWrap option is set Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-06 15:37:26 UTC (rev 1176) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-06 16:17:19 UTC (rev 1177) @@ -1268,4 +1268,12 @@ public void setSortAttributes(final AttrSortStrategy sortAttributes) { set(Option.SortAttributes, sortAttributes); } + + public boolean isPunctWrap() { + return getBool(Option.PunctWrap); + } + + public void setPunctWrap(final boolean punctWrap) { + set(Option.PunctWrap, punctWrap); + } } Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java 2010-11-06 15:37:26 UTC (rev 1176) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java 2010-11-06 16:17:19 UTC (rev 1177) @@ -708,7 +708,7 @@ // But we leave the ASCII range punctuation untouched // Break after any punctuation or spaces characters - if ((c >= 0x2000) && !TidyUtils.toBoolean(mode & PREFORMATTED)) + if ((c >= 0x2000) && !TidyUtils.toBoolean(mode & PREFORMATTED) && configuration.isPunctWrap()) { if (((c >= 0x2000) && (c <= 0x2006)) || ((c >= 0x2008) && (c <= 0x2010)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 15:37:32
|
Revision: 1176 http://jtidy.svn.sourceforge.net/jtidy/?rev=1176&view=rev Author: aditsu Date: 2010-11-06 15:37:26 +0000 (Sat, 06 Nov 2010) Log Message: ----------- fixed test 590716 - don't escape ampersand when preserving entities Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java 2010-11-06 15:32:05 UTC (rev 1175) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java 2010-11-06 15:37:26 UTC (rev 1176) @@ -663,7 +663,7 @@ // naked '&' chars can be left alone or quoted as & // The latter is required for XML where naked '&' are illegal. - if (c == '&' && this.configuration.isQuoteAmpersand()) { + if (c == '&' && this.configuration.isQuoteAmpersand() && !configuration.isPreserveEntities()) { addString("&"); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 15:32:11
|
Revision: 1175 http://jtidy.svn.sourceforge.net/jtidy/?rev=1175&view=rev Author: aditsu Date: 2010-11-06 15:32:05 +0000 (Sat, 06 Nov 2010) Log Message: ----------- simplified printChar using addString and addChar Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java 2010-11-06 15:04:52 UTC (rev 1174) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java 2010-11-06 15:32:05 UTC (rev 1175) @@ -627,30 +627,16 @@ String entity; boolean breakable = false; // #431953 - RJ - if (c == ' ' && !TidyUtils.toBoolean(mode & (PREFORMATTED | COMMENT | ATTRIBVALUE | CDATA))) - { + if (c == ' ' && !TidyUtils.toBoolean(mode & (PREFORMATTED | COMMENT | ATTRIBVALUE | CDATA))) { // coerce a space character to a non-breaking space - if (TidyUtils.toBoolean(mode & NOWRAP)) - { + if (TidyUtils.toBoolean(mode & NOWRAP)) { // by default XML doesn't define - if (this.configuration.isNumEntities() || this.configuration.isXmlTags()) - { - addC('&', linelen++); - addC('#', linelen++); - addC('1', linelen++); - addC('6', linelen++); - addC('0', linelen++); - addC(';', linelen++); + if (this.configuration.isNumEntities() || this.configuration.isXmlTags()) { + addString(" "); } - else - { + else { // otherwise use named entity - addC('&', linelen++); - addC('n', linelen++); - addC('b', linelen++); - addC('s', linelen++); - addC('p', linelen++); - addC(';', linelen++); + addString(" "); } return; } @@ -658,96 +644,54 @@ } // comment characters are passed raw - if (TidyUtils.toBoolean(mode & (COMMENT | CDATA))) - { - addC(c, linelen++); + if (TidyUtils.toBoolean(mode & (COMMENT | CDATA))) { + addChar(c); return; } // except in CDATA map < to < etc. - if (!TidyUtils.toBoolean(mode & CDATA)) - { - if (c == '<') - { - addC('&', linelen++); - addC('l', linelen++); - addC('t', linelen++); - addC(';', linelen++); + if (!TidyUtils.toBoolean(mode & CDATA)) { + if (c == '<') { + addString("<"); return; } - if (c == '>') - { - addC('&', linelen++); - addC('g', linelen++); - addC('t', linelen++); - addC(';', linelen++); + if (c == '>') { + addString(">"); return; } // naked '&' chars can be left alone or quoted as & // The latter is required for XML where naked '&' are illegal. - if (c == '&' && this.configuration.isQuoteAmpersand()) - { - addC('&', linelen++); - addC('a', linelen++); - addC('m', linelen++); - addC('p', linelen++); - addC(';', linelen++); + if (c == '&' && this.configuration.isQuoteAmpersand()) { + addString("&"); return; } - if (c == '"' && this.configuration.isQuoteMarks()) - { - addC('&', linelen++); - addC('q', linelen++); - addC('u', linelen++); - addC('o', linelen++); - addC('t', linelen++); - addC(';', linelen++); + if (c == '"' && this.configuration.isQuoteMarks()) { + addString("""); return; } - if (c == '\'' && this.configuration.isQuoteMarks()) - { - addC('&', linelen++); - addC('#', linelen++); - addC('3', linelen++); - addC('9', linelen++); - addC(';', linelen++); + if (c == '\'' && this.configuration.isQuoteMarks()) { + addString("'"); return; } - if (c == 160 && !this.configuration.isRawOut()) - { - if (this.configuration.isMakeBare()) - { - addC(' ', linelen++); + if (c == 160 && !this.configuration.isRawOut()) { + if (this.configuration.isMakeBare()) { + addChar(' '); } - else if (this.configuration.isQuoteNbsp()) - { - addC('&', linelen++); - - if (this.configuration.isNumEntities() || this.configuration.isXmlTags()) - { - addC('#', linelen++); - addC('1', linelen++); - addC('6', linelen++); - addC('0', linelen++); + else if (this.configuration.isQuoteNbsp()) { + if (this.configuration.isNumEntities() || this.configuration.isXmlTags()) { + addString(" "); } - else - { - addC('n', linelen++); - addC('b', linelen++); - addC('s', linelen++); - addC('p', linelen++); + else { + addString(" "); } - - addC(';', linelen++); } - else - { - addC(c, linelen++); + else { + addChar(c); } return; @@ -788,7 +732,7 @@ || ((c >= 0xFF3B) && (c <= 0xFF3D)) || ((c >= 0xFF61) && (c <= 0xFF65))) { - wraphere = linelen + 1; + wraphere = linelen + 2; // 2, because AddChar is not till later breakable = true; } else @@ -802,7 +746,7 @@ case 0xFF3F : case 0xFF5B : case 0xFF5D : - wraphere = linelen + 1; + wraphere = linelen + 2; breakable = true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 15:04:58
|
Revision: 1174 http://jtidy.svn.sourceforge.net/jtidy/?rev=1174&view=rev Author: aditsu Date: 2010-11-06 15:04:52 +0000 (Sat, 06 Nov 2010) Log Message: ----------- fixed test 1720953 - implemented attribute sorting Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-06 14:34:06 UTC (rev 1173) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-06 15:04:52 UTC (rev 1174) @@ -62,6 +62,7 @@ import java.util.Map; import java.util.Properties; +import org.w3c.tidy.Options.AttrSortStrategy; import org.w3c.tidy.Options.DoctypeModes; import org.w3c.tidy.Options.DupAttrModes; import org.w3c.tidy.Options.LineEnding; @@ -1259,4 +1260,12 @@ protected boolean isTidyCompat() { return getBool(Option.TidyCompat); } -} \ No newline at end of file + + public AttrSortStrategy getSortAttributes() { + return (AttrSortStrategy) getOptionEnum(Option.SortAttributes); + } + + public void setSortAttributes(final AttrSortStrategy sortAttributes) { + set(Option.SortAttributes, sortAttributes); + } +} Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java 2010-11-06 14:34:06 UTC (rev 1173) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java 2010-11-06 15:04:52 UTC (rev 1174) @@ -64,11 +64,16 @@ import java.io.Reader; import java.io.Serializable; import java.io.Writer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Properties; import org.w3c.tidy.Node.NodeType; +import org.w3c.tidy.Options.AttrSortStrategy; import org.w3c.tidy.Options.DoctypeModes; import org.w3c.tidy.Options.DupAttrModes; import org.w3c.tidy.Options.TriState; @@ -571,6 +576,11 @@ Clean.wbrToSpace(lexer, lexer.root); } + final AttrSortStrategy sortAttrStrat = configuration.getSortAttributes(); + if (sortAttrStrat != AttrSortStrategy.None) { + sortAttributes(lexer.root, sortAttrStrat); + } + pprint = new PPrint(configuration); if (showBodyOnly(lexer)) { @@ -602,8 +612,46 @@ return document; } + + private AttVal sortAttVal(final AttVal list, final AttrSortStrategy strat) { + // quick hack for now + final List<AttVal> l = new ArrayList<AttVal>(); + AttVal x = list; + while (x != null) { + l.add(x); + x = x.next; + } + if (strat != AttrSortStrategy.Alpha) { + throw new IllegalArgumentException("Unexpected sort strategy: " + strat); + } + if (l.size() < 2) { + return list; + } + Collections.sort(l, new Comparator<AttVal>() { + public int compare(final AttVal a1, final AttVal a2) { + return a1.attribute.compareTo(a2.attribute); + } + }); + final int n = l.size(); + l.add(null); + for (int i = 0; i < n; ++i) { + l.get(i).next = l.get(i + 1); + } + return l.get(0); + } + + private void sortAttributes(final Node node, final AttrSortStrategy strat) { + Node x = node; + while (x != null) { + x.attributes = sortAttVal(x.attributes, strat); + if (x.content != null) { + sortAttributes(x.content, strat); + } + x = x.next; + } + } - /** + /** * Internal routine that actually does the parsing. The caller can pass either an InputStream or file name. If both * are passed, the file name is preferred. * @param in input stream (used only if <code>file</code> is null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 14:34:12
|
Revision: 1173 http://jtidy.svn.sourceforge.net/jtidy/?rev=1173&view=rev Author: aditsu Date: 2010-11-06 14:34:06 +0000 (Sat, 06 Nov 2010) Log Message: ----------- modified diff to show 2 lines in case of mismatch Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyTester.java Modified: branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyTester.java =================================================================== --- branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyTester.java 2010-11-06 14:32:58 UTC (rev 1172) +++ branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyTester.java 2010-11-06 14:34:06 UTC (rev 1173) @@ -111,9 +111,11 @@ break; } } + l1 += '\n' + br1.readLine(); + l2 += '\n' + br2.readLine(); br1.close(); br2.close(); - fail(what + " differ at byte " + x + ":\nExpect: " + l2 + "\nActual: " + l1); + fail(what + " differ at byte " + x + ":\nExpected:\n" + l2 + "\nActual:\n" + l1); } if (b1 == -1) { break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 14:33:04
|
Revision: 1172 http://jtidy.svn.sourceforge.net/jtidy/?rev=1172&view=rev Author: aditsu Date: 2010-11-06 14:32:58 +0000 (Sat, 06 Nov 2010) Log Message: ----------- fixed test 1632218 - modified encodingError to use the decimal character value for INVALID_NCR, and adjusted messages Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-06 13:54:31 UTC (rev 1171) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-06 14:32:58 UTC (rev 1172) @@ -514,11 +514,7 @@ break; case INVALID_NCR: lexer.badChars |= BC_INVALID_NCR; - messageLexer( - lexer, - Level.WARNING, - code, - replaceMode, buf); + messageLexer(lexer, Level.WARNING, code, replaceMode, c); break; } } Modified: branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties =================================================================== --- branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-06 13:54:31 UTC (rev 1171) +++ branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-06 14:32:58 UTC (rev 1172) @@ -54,7 +54,7 @@ invalid_attribute={0} attribute name "{1}" (value="{2}") is invalid invalid_char={0,choice,0#replacing|1#discarding} invalid character code {1} invalid_ncr={0,choice,0#replacing|1#discarding} invalid numeric character reference {1} -invalid_sgml_chars=Character codes 128 to 159 (U+0080 to U+009F) are not allowed in HTML;\u000aeven if they were, they would likely be unprintable control characters.\u000aTidy assumed you wanted to refer to a character with the same byte value in the \u000a{0,choice,0#specified|1#Windows-1252|2#MacRoman} encoding and replaced that reference with the Unicode equivalent. +invalid_sgml_chars=Character codes 128 to 159 (U+0080 to U+009F) are not allowed in HTML;\u000aeven if they were, they would likely be unprintable control characters.\u000aTidy assumed you wanted to refer to a character with the same byte value in the \u000a{0,choice,0#specified|1#Windows-1252|2#MacRoman} encoding and replaced that reference with the Unicode equivalent.\n invalid_utf16={0,choice,0#replacing|1#discarding} invalid UTF-16 surrogate pair (char. code {1}) invalid_utf16_summary=Character codes for UTF-16 must be in the range: U+0000 to U+10FFFF.\u000aThe definition of UTF-16 in Annex C of ISO/IEC 10646-1:2000 does not allow the\u000amapping of unpaired surrogates. For more information please refer to\u000ahttp://www.unicode.org/unicode and http://www.cl.cam.ac.uk/~mgk25/unicode.html invalid_utf8={0,choice,0#replacing|1#discarding} invalid UTF-8 bytes (char. code {1}) @@ -74,7 +74,7 @@ missing_imagemap={0} should use client-side image map missing_quotemark={0} attribute with missing trailing quote mark missing_semicolon=entity "{0}" doesn''t end in '';'' -missing_semicolon_ncr=numeric character reference "{0}" doesn''t end in ";" +missing_semicolon_ncr=numeric character reference "{0}" doesn''t end in '';'' missing_starttag=missing <{0}> missing_title_element=inserting missing ''title'' element needs_author_intervention=This document has errors that must be fixed before\u000ausing HTML Tidy to generate a tidied up version.\n This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 13:54:37
|
Revision: 1171 http://jtidy.svn.sourceforge.net/jtidy/?rev=1171&view=rev Author: aditsu Date: 2010-11-06 13:54:31 +0000 (Sat, 06 Nov 2010) Log Message: ----------- added extra condition (from the C code) for calling errorSummary in Tidy compatibility mode - fixes 3 test cases Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java 2010-11-06 13:04:54 UTC (rev 1170) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java 2010-11-06 13:54:31 UTC (rev 1171) @@ -590,8 +590,9 @@ o.flush(); } - if (!configuration.isQuiet()) - { + // Tidy only shows the error summary when there are errors and/or warnings, + // but that can miss e.g. badlayout messages + if ((!configuration.isTidyCompat() || parseErrors + parseWarnings > 0) && !configuration.isQuiet()) { this.report.errorSummary(lexer); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 13:05:00
|
Revision: 1170 http://jtidy.svn.sourceforge.net/jtidy/?rev=1170&view=rev Author: aditsu Date: 2010-11-06 13:04:54 +0000 (Sat, 06 Nov 2010) Log Message: ----------- changed all formerly null message levels to SUMMARY, and modified message processing methods to treat it as before (not outputting the level name and line/column numbers), to keep compatibility with Tidy Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-06 12:47:21 UTC (rev 1169) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-06 13:04:54 UTC (rev 1170) @@ -292,7 +292,7 @@ boolean go = updateCount(lexer, level); if (go) { String position = line > 0 && col > 0 ? getPosition(lexer, line, col) : ""; - String prefix = level == null ? "" : (level + ": "); + String prefix = level == Level.SUMMARY ? "" : (level + ": "); String messageString = MessageFormat.format(res.getString(messageKey), args); if (listener != null) { TidyMessage msg = new TidyMessage(errorCode, line, col, level, messageString); @@ -342,7 +342,7 @@ private void messageLexer(final int errorCode, final Lexer lexer, final Level level, final String messageKey, final Object... params) { - final boolean b = lexer != null && level != null; + final boolean b = lexer != null && level != Level.SUMMARY; messagePos(errorCode, lexer, level, b ? lexer.lines : 0, b ? lexer.columns : 0, messageKey, params); } @@ -936,27 +936,27 @@ { if ((lexer.badAccess & MISSING_SUMMARY) != 0) { - messageLexer(MISSING_SUMMARY, lexer, Level.WARNING, "badaccess_missing_summary"); + messageLexer(MISSING_SUMMARY, lexer, Level.SUMMARY, "badaccess_missing_summary"); } if ((lexer.badAccess & MISSING_IMAGE_ALT) != 0) { - messageLexer(MISSING_IMAGE_ALT, lexer, Level.WARNING, "badaccess_missing_image_alt"); + messageLexer(MISSING_IMAGE_ALT, lexer, Level.SUMMARY, "badaccess_missing_image_alt"); } if ((lexer.badAccess & MISSING_IMAGE_MAP) != 0) { - messageLexer(MISSING_IMAGE_MAP, lexer, Level.WARNING, "badaccess_missing_image_map"); + messageLexer(MISSING_IMAGE_MAP, lexer, Level.SUMMARY, "badaccess_missing_image_map"); } if ((lexer.badAccess & MISSING_LINK_ALT) != 0) { - messageLexer(MISSING_LINK_ALT, lexer, Level.WARNING, "badaccess_missing_link_alt"); + messageLexer(MISSING_LINK_ALT, lexer, Level.SUMMARY, "badaccess_missing_link_alt"); } if (((lexer.badAccess & USING_FRAMES) != 0) && ((lexer.badAccess & USING_NOFRAMES) == 0)) { - messageLexer(USING_FRAMES, lexer, Level.WARNING, "badaccess_frames"); + messageLexer(USING_FRAMES, lexer, Level.SUMMARY, "badaccess_frames"); } messageLexer(lexer, Level.SUMMARY, lexer.configuration.isTidyCompat() ? BADACCESS_SUMMARY_BAD @@ -1018,7 +1018,7 @@ */ public void needsAuthorIntervention(PrintWriter errout) { - printMessage(errout, Level.INFO, "needs_author_intervention"); + printMessage(errout, Level.SUMMARY, "needs_author_intervention"); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 12:47:27
|
Revision: 1169 http://jtidy.svn.sourceforge.net/jtidy/?rev=1169&view=rev Author: aditsu Date: 2010-11-06 12:47:21 +0000 (Sat, 06 Nov 2010) Log Message: ----------- reverted to keep compatibility with Tidy Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties Modified: branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties =================================================================== --- branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-06 06:50:14 UTC (rev 1168) +++ branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-06 12:47:21 UTC (rev 1169) @@ -82,10 +82,10 @@ nested_quotation=nested q elements, possible typo. newline_in_uri={0} discarding newline in URI reference no_si=No system identifier in emitted doctype -no_warnings=No warnings or errors were found. +no_warnings=No warnings or errors were found.\n noframes_content={0} not inside ''noframes'' element non_matching_endtag=replacing unexpected {0} by </{1}> -num_warnings={0,choice,0#0 warnings|1#1 warning|1<{0,number,integer} warnings}, {1,choice,0#0 errors|1#1 error|2#{1,number,integer} errors} were found! +num_warnings={0,choice,0#0 warnings|1#1 warning|1<{0,number,integer} warnings}, {1,choice,0#0 errors|1#1 error|2#{1,number,integer} errors} were found!\n obsolete_element=replacing obsolete element {0} by {1} previous_location=<{0}> previously mentioned proprietary_attr_value={0} proprietary attribute value "{1}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-06 06:50:20
|
Revision: 1168 http://jtidy.svn.sourceforge.net/jtidy/?rev=1168&view=rev Author: aditsu Date: 2010-11-06 06:50:14 +0000 (Sat, 06 Nov 2010) Log Message: ----------- fixed and simplified fixXmlDecl (backported from java5 branch rev 1041) Revision Links: -------------- http://jtidy.svn.sourceforge.net/jtidy/?rev=1041&view=rev Modified Paths: -------------- trunk/jtidy/src/main/java/org/w3c/tidy/Lexer.java Modified: trunk/jtidy/src/main/java/org/w3c/tidy/Lexer.java =================================================================== --- trunk/jtidy/src/main/java/org/w3c/tidy/Lexer.java 2010-11-01 15:23:15 UTC (rev 1167) +++ trunk/jtidy/src/main/java/org/w3c/tidy/Lexer.java 2010-11-06 06:50:14 UTC (rev 1168) @@ -1678,22 +1678,11 @@ AttVal version; AttVal encoding; - if (root.content != null && root.content.type == Node.XML_DECL) - { + if (root.content != null && root.content.type == Node.XML_DECL) { xml = root.content; - } - else - { + } else { xml = newNode(Node.XML_DECL, this.lexbuf, 0, 0); - xml.next = root.content; - - if (root.content != null) - { - root.content.prev = xml; - xml.next = root.content; - } - - root.content = xml; + root.insertNodeAtStart(xml); } version = xml.getAttrByName("version"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-11-01 15:23:21
|
Revision: 1167 http://jtidy.svn.sourceforge.net/jtidy/?rev=1167&view=rev Author: fgiust Date: 2010-11-01 15:23:15 +0000 (Mon, 01 Nov 2010) Log Message: ----------- updated tests for changed report messages Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/ReportTest.java Modified: branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties =================================================================== --- branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-01 15:05:00 UTC (rev 1166) +++ branches/CodeUpdateAndJava5/src/main/resources/org/w3c/tidy/TidyMessages.properties 2010-11-01 15:23:15 UTC (rev 1167) @@ -82,10 +82,10 @@ nested_quotation=nested q elements, possible typo. newline_in_uri={0} discarding newline in URI reference no_si=No system identifier in emitted doctype -no_warnings=No warnings or errors were found.\n +no_warnings=No warnings or errors were found. noframes_content={0} not inside ''noframes'' element non_matching_endtag=replacing unexpected {0} by </{1}> -num_warnings={0,choice,0#0 warnings|1#1 warning|1<{0,number,integer} warnings}, {1,choice,0#0 errors|1#1 error|2#{1,number,integer} errors} were found!\n +num_warnings={0,choice,0#0 warnings|1#1 warning|1<{0,number,integer} warnings}, {1,choice,0#0 errors|1#1 error|2#{1,number,integer} errors} were found! obsolete_element=replacing obsolete element {0} by {1} previous_location=<{0}> previously mentioned proprietary_attr_value={0} proprietary attribute value "{1}" Modified: branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/ReportTest.java =================================================================== --- branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/ReportTest.java 2010-11-01 15:05:00 UTC (rev 1166) +++ branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/ReportTest.java 2010-11-01 15:23:15 UTC (rev 1167) @@ -153,7 +153,7 @@ TidyMessage.Level.INFO, "nested_emphasis", new Object[]{"test"}); - assertEquals("line 12 column 34 - nested emphasis test", message); + assertEquals("line 12 column 34 - Info: nested emphasis test", message); } /** @@ -168,7 +168,7 @@ TidyMessage.Level.INFO, "coerce_to_endtag", new Object[]{"test"}); - assertEquals("line 12 column 34 - <test> is probably intended as </test>", message); + assertEquals("line 12 column 34 - Info: <test> is probably intended as </test>", message); } /** @@ -313,7 +313,7 @@ TidyMessage.Level.WARNING, "replacing_element", new Object[]{"<test>", "<bee>"}); - assertEquals("line 12 column 34 - Warning: replacing element <test> by <bee>", message); + assertEquals("line 12 column 34 - Warning: replacing <test> by <bee>", message); } /** @@ -473,7 +473,7 @@ TidyMessage.Level.WARNING, "unexpected_end_of_file", new Object[]{"<test>"}); - assertEquals("line 12 column 34 - Warning: end of file while parsing attributes <test>", message); + assertEquals("line 12 column 34 - Warning: <test> end of file while parsing attributes", message); } /** @@ -774,8 +774,8 @@ lexer, null, "doctype_given", - new Object[]{"test", "bee"}); - assertEquals("test: Doctype given is \"bee\"", message); + new Object[]{"bee"}); + assertEquals("Doctype given is \"bee\"", message); } /** @@ -789,8 +789,8 @@ lexer, null, "report_version", - new Object[]{"test", "bee"}); - assertEquals("test: Document content looks like bee", message); + new Object[]{"bee"}); + assertEquals("Document content looks like bee", message); } /** @@ -805,7 +805,7 @@ null, "num_warnings", new Object[]{new Integer(0), new Integer(33)}); - assertEquals("no warnings, 33 errors were found!", message); + assertEquals("0 warnings, 33 errors were found!", message); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-11-01 15:05:06
|
Revision: 1166 http://jtidy.svn.sourceforge.net/jtidy/?rev=1166&view=rev Author: fgiust Date: 2010-11-01 15:05:00 +0000 (Mon, 01 Nov 2010) Log Message: ----------- trying to fix message levels in order to keep the same behavior from trunk Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyMessage.java branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyTestCase.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-01 14:31:21 UTC (rev 1165) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-01 15:05:00 UTC (rev 1166) @@ -892,7 +892,7 @@ encodingChoiche = 2; } - messageLexer(lexer, null, VENDOR_SPECIFIC_CHARS, encodingChoiche); + messageLexer(lexer, Level.SUMMARY, VENDOR_SPECIFIC_CHARS, encodingChoiche); } if ((lexer.badChars & BC_INVALID_SGML_CHARS) != 0 || (lexer.badChars & BC_INVALID_NCR) != 0) @@ -908,58 +908,58 @@ encodingChoiche = 2; } - messageLexer(lexer, null, INVALID_SGML_CHARS, encodingChoiche); + messageLexer(lexer, Level.SUMMARY, INVALID_SGML_CHARS, encodingChoiche); } if ((lexer.badChars & BC_INVALID_UTF8) != 0) { - messageLexer(INVALID_UTF8.code(), lexer, null, "invalid_utf8_summary"); + messageLexer(INVALID_UTF8.code(), lexer, Level.SUMMARY, "invalid_utf8_summary"); } if ((lexer.badChars & BC_INVALID_UTF16) != 0) { - messageLexer(INVALID_UTF16.code(), lexer, null, "invalid_utf16_summary"); + messageLexer(INVALID_UTF16.code(), lexer, Level.SUMMARY, "invalid_utf16_summary"); } if ((lexer.badChars & BC_INVALID_URI) != 0) { - messageLexer(INVALID_URI.code(), lexer, null, "invaliduri_summary"); + messageLexer(INVALID_URI.code(), lexer, Level.SUMMARY, "invaliduri_summary"); } } if (lexer.badForm != 0) { - messageLexer(lexer, null, BADFORM_SUMMARY); + messageLexer(lexer, Level.SUMMARY, BADFORM_SUMMARY); } if (lexer.badAccess != 0) { if ((lexer.badAccess & MISSING_SUMMARY) != 0) { - messageLexer(MISSING_SUMMARY, lexer, null, "badaccess_missing_summary"); + messageLexer(MISSING_SUMMARY, lexer, Level.WARNING, "badaccess_missing_summary"); } if ((lexer.badAccess & MISSING_IMAGE_ALT) != 0) { - messageLexer(MISSING_IMAGE_ALT, lexer, null, "badaccess_missing_image_alt"); + messageLexer(MISSING_IMAGE_ALT, lexer, Level.WARNING, "badaccess_missing_image_alt"); } if ((lexer.badAccess & MISSING_IMAGE_MAP) != 0) { - messageLexer(MISSING_IMAGE_MAP, lexer, null, "badaccess_missing_image_map"); + messageLexer(MISSING_IMAGE_MAP, lexer, Level.WARNING, "badaccess_missing_image_map"); } if ((lexer.badAccess & MISSING_LINK_ALT) != 0) { - messageLexer(MISSING_LINK_ALT, lexer, null, "badaccess_missing_link_alt"); + messageLexer(MISSING_LINK_ALT, lexer, Level.WARNING, "badaccess_missing_link_alt"); } if (((lexer.badAccess & USING_FRAMES) != 0) && ((lexer.badAccess & USING_NOFRAMES) == 0)) { - messageLexer(USING_FRAMES, lexer, null, "badaccess_frames"); + messageLexer(USING_FRAMES, lexer, Level.WARNING, "badaccess_frames"); } - messageLexer(lexer, null, lexer.configuration.isTidyCompat() ? BADACCESS_SUMMARY_BAD + messageLexer(lexer, Level.SUMMARY, lexer.configuration.isTidyCompat() ? BADACCESS_SUMMARY_BAD : BADACCESS_SUMMARY, ACCESS_URL); } @@ -967,27 +967,27 @@ { if ((lexer.badLayout & USING_LAYER) != 0) { - messageLexer(USING_LAYER, lexer, null, "badlayout_using_layer"); + messageLexer(USING_LAYER, lexer, Level.SUMMARY, "badlayout_using_layer"); } if ((lexer.badLayout & USING_SPACER) != 0) { - messageLexer(USING_SPACER, lexer, null, "badlayout_using_spacer"); + messageLexer(USING_SPACER, lexer, Level.SUMMARY, "badlayout_using_spacer"); } if ((lexer.badLayout & USING_FONT) != 0) { - messageLexer(USING_FONT, lexer, null, "badlayout_using_font"); + messageLexer(USING_FONT, lexer, Level.SUMMARY, "badlayout_using_font"); } if ((lexer.badLayout & USING_NOBR) != 0) { - messageLexer(USING_NOBR, lexer, null, "badlayout_using_nobr"); + messageLexer(USING_NOBR, lexer, Level.SUMMARY, "badlayout_using_nobr"); } if ((lexer.badLayout & USING_BODY) != 0) { - messageLexer(USING_BODY, lexer, null, "badlayout_using_body"); + messageLexer(USING_BODY, lexer, Level.SUMMARY, "badlayout_using_body"); } } } @@ -1018,7 +1018,7 @@ */ public void needsAuthorIntervention(PrintWriter errout) { - printMessage(errout, null, "needs_author_intervention"); + printMessage(errout, Level.INFO, "needs_author_intervention"); } /** @@ -1037,7 +1037,7 @@ */ public void reportNumberOfSlides(PrintWriter errout, int count) { - printMessage(errout, null, "slides_found", new Integer(count)); + printMessage(errout, Level.SUMMARY, "slides_found", new Integer(count)); } /** @@ -1090,13 +1090,13 @@ { printMessage( errout, - null, + Level.SUMMARY, "num_warnings", lexer.warnings, lexer.errors); } else { - printMessage(errout, null, "no_warnings"); + printMessage(errout, Level.SUMMARY, "no_warnings"); } } Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyMessage.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyMessage.java 2010-11-01 14:31:21 UTC (rev 1165) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyMessage.java 2010-11-01 15:05:00 UTC (rev 1166) @@ -102,7 +102,7 @@ this.errorCode = errorCode; this.line = line; this.column = column; - this.level = level != null ? level : TidyMessage.Level.INFO; + this.level = level; this.message = message; } @@ -157,21 +157,24 @@ * @version $Revision$ ($Author$) */ public enum Level { - /** Information about markup usage */ + /** Summary (number of warnings, errors) */ + SUMMARY("Summary"), + + /** Information about markup usage */ INFO("Info"), /** Warning message */ WARNING("Warning"), + /** Error message - output suppressed */ + ERROR("Error"), + /** Configuration error */ CONFIG("Config"), /** Accessibility message */ ACCESS("Access"), - /** Error message - output suppressed */ - ERROR("Error"), - /** I/O or file system error */ BAD_DOCUMENT("Document"), Modified: branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyTestCase.java =================================================================== --- branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyTestCase.java 2010-11-01 14:31:21 UTC (rev 1165) +++ branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyTestCase.java 2010-11-01 15:05:00 UTC (rev 1166) @@ -692,7 +692,7 @@ this.code = Integer.parseInt(new String(ch, start, length)); break; case 2 : -//FIXME this.level = Integer.parseInt(new String(ch, start, length)); + this.level = Level.values()[Integer.parseInt(new String(ch, start, length))]; break; case 3 : this.line = Integer.parseInt(new String(ch, start, length)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-11-01 14:31:29
|
Revision: 1165 http://jtidy.svn.sourceforge.net/jtidy/?rev=1165&view=rev Author: fgiust Date: 2010-11-01 14:31:21 +0000 (Mon, 01 Nov 2010) Log Message: ----------- don't generate messages without a level. Defaults to info for unset levels. Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyMessage.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyMessage.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyMessage.java 2010-11-01 13:58:23 UTC (rev 1164) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyMessage.java 2010-11-01 14:31:21 UTC (rev 1165) @@ -102,7 +102,7 @@ this.errorCode = errorCode; this.line = line; this.column = column; - this.level = level; + this.level = level != null ? level : TidyMessage.Level.INFO; this.message = message; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-11-01 13:58:29
|
Revision: 1164 http://jtidy.svn.sourceforge.net/jtidy/?rev=1164&view=rev Author: fgiust Date: 2010-11-01 13:58:23 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Merged revisions 1163 via svnmerge from https://jtidy.svn.sourceforge.net/svnroot/jtidy/trunk/jtidy ........ r1163 | fgiust | 2010-11-01 14:35:43 +0100 (Mon, 01 Nov 2010) | 1 line tests cleanup ........ Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyEncodingBugsTest.java Removed Paths: ------------- branches/CodeUpdateAndJava5/src/test/resources/1097062.msg Property Changed: ---------------- branches/CodeUpdateAndJava5/ Property changes on: branches/CodeUpdateAndJava5 ___________________________________________________________________ Modified: svnmerge-integrated - /trunk/jtidy:1-872,874-879,881-898,900-906,908-909,911,913-914,917,920,922,924,926,928-929,931,933,935,937,939-1032,1034-1093,1098,1101-1102,1105,1108-1115,1119,1124,1126-1127,1130,1133-1139,1142-1160 + /trunk/jtidy:1-872,874-879,881-898,900-906,908-909,911,913-914,917,920,922,924,926,928-929,931,933,935,937,939-1032,1034-1093,1098,1101-1102,1105,1108-1115,1119,1124,1126-1127,1130,1133-1139,1142-1160,1163 Modified: svn:mergeinfo - /trunk/jtidy:1143-1151,1154-1160 + /trunk/jtidy:1143-1151,1154-1160,1163 Modified: branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyEncodingBugsTest.java =================================================================== --- branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyEncodingBugsTest.java 2010-11-01 13:35:43 UTC (rev 1163) +++ branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyEncodingBugsTest.java 2010-11-01 13:58:23 UTC (rev 1164) @@ -98,8 +98,7 @@ */ public void test658230() throws Exception { - throw new Exception("disabled"); - // executeTidyTest("658230.html"); + executeTidyTest("658230.html"); } /** Deleted: branches/CodeUpdateAndJava5/src/test/resources/1097062.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/1097062.msg 2010-11-01 13:35:43 UTC (rev 1163) +++ branches/CodeUpdateAndJava5/src/test/resources/1097062.msg 2010-11-01 13:58:23 UTC (rev 1164) @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- expected messages for test 1097062--> -<messages> - <message> - <code>48</code> - <level>2</level> - <line>2</line> - <column>1</column> - <text><![CDATA[unknown attribute "xmlns:dt"]]></text> - </message> - <message> - <code>48</code> - <level>2</level> - <line>2</line> - <column>1</column> - <text><![CDATA[unknown attribute "xmlns:w"]]></text> - </message> - <message> - <code>48</code> - <level>2</level> - <line>2</line> - <column>1</column> - <text><![CDATA[unknown attribute "xmlns:o"]]></text> - </message> - <message> - <code>9</code> - <level>1</level> - <line>8</line> - <column>10</column> - <text><![CDATA[nested emphasis <span>]]></text> - </message> - <message> - <code>9</code> - <level>1</level> - <line>8</line> - <column>16</column> - <text><![CDATA[nested emphasis <span>]]></text> - </message> - <message> - <code>9</code> - <level>1</level> - <line>8</line> - <column>54</column> - <text><![CDATA[nested emphasis <span>]]></text> - </message> - <message> - <code>110</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Doctype given is "-//W3C//DTD XHTML 1.0 Strict//EN"]]></text> - </message> - <message> - <code>111</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Document content looks like HTML 3.2]]></text> - </message> - <message> - <code>-1</code> - <level>0</level> - <line>0</line> - <column>0</column> - <text><![CDATA[6 warnings, no errors were found!]]></text> - </message> -</messages> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-11-01 13:35:49
|
Revision: 1163 http://jtidy.svn.sourceforge.net/jtidy/?rev=1163&view=rev Author: fgiust Date: 2010-11-01 13:35:43 +0000 (Mon, 01 Nov 2010) Log Message: ----------- tests cleanup Modified Paths: -------------- trunk/jtidy/src/test/java/org/w3c/tidy/TidyEncodingBugsTest.java Removed Paths: ------------- trunk/jtidy/src/test/resources/1097062.msg Modified: trunk/jtidy/src/test/java/org/w3c/tidy/TidyEncodingBugsTest.java =================================================================== --- trunk/jtidy/src/test/java/org/w3c/tidy/TidyEncodingBugsTest.java 2010-11-01 13:32:53 UTC (rev 1162) +++ trunk/jtidy/src/test/java/org/w3c/tidy/TidyEncodingBugsTest.java 2010-11-01 13:35:43 UTC (rev 1163) @@ -98,8 +98,7 @@ */ public void test658230() throws Exception { - throw new Exception("disabled"); - // executeTidyTest("658230.html"); + executeTidyTest("658230.html"); } /** Deleted: trunk/jtidy/src/test/resources/1097062.msg =================================================================== --- trunk/jtidy/src/test/resources/1097062.msg 2010-11-01 13:32:53 UTC (rev 1162) +++ trunk/jtidy/src/test/resources/1097062.msg 2010-11-01 13:35:43 UTC (rev 1163) @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- expected messages for test 1097062--> -<messages> - <message> - <code>48</code> - <level>2</level> - <line>2</line> - <column>1</column> - <text><![CDATA[unknown attribute "xmlns:dt"]]></text> - </message> - <message> - <code>48</code> - <level>2</level> - <line>2</line> - <column>1</column> - <text><![CDATA[unknown attribute "xmlns:w"]]></text> - </message> - <message> - <code>48</code> - <level>2</level> - <line>2</line> - <column>1</column> - <text><![CDATA[unknown attribute "xmlns:o"]]></text> - </message> - <message> - <code>9</code> - <level>1</level> - <line>8</line> - <column>10</column> - <text><![CDATA[nested emphasis <span>]]></text> - </message> - <message> - <code>9</code> - <level>1</level> - <line>8</line> - <column>16</column> - <text><![CDATA[nested emphasis <span>]]></text> - </message> - <message> - <code>9</code> - <level>1</level> - <line>8</line> - <column>54</column> - <text><![CDATA[nested emphasis <span>]]></text> - </message> - <message> - <code>110</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Doctype given is "-//W3C//DTD XHTML 1.0 Strict//EN"]]></text> - </message> - <message> - <code>111</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Document content looks like HTML 3.2]]></text> - </message> - <message> - <code>-1</code> - <level>0</level> - <line>0</line> - <column>0</column> - <text><![CDATA[6 warnings, no errors were found!]]></text> - </message> -</messages> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-11-01 13:33:00
|
Revision: 1162 http://jtidy.svn.sourceforge.net/jtidy/?rev=1162&view=rev Author: fgiust Date: 2010-11-01 13:32:53 +0000 (Mon, 01 Nov 2010) Log Message: ----------- #3057375 revert commit 1007 which caused a NPE in PPrint.printText Modified Paths: -------------- trunk/jtidy/src/main/java/org/w3c/tidy/Node.java Modified: trunk/jtidy/src/main/java/org/w3c/tidy/Node.java =================================================================== --- trunk/jtidy/src/main/java/org/w3c/tidy/Node.java 2010-11-01 13:07:20 UTC (rev 1161) +++ trunk/jtidy/src/main/java/org/w3c/tidy/Node.java 2010-11-01 13:32:53 UTC (rev 1162) @@ -921,9 +921,24 @@ { // create new node node = lexer.newNode(); - node.start = element.start++; - node.end = element.start; - lexer.lexbuf[node.start] = (byte) ' '; + // Local fix for bug 228486 (GLP). This handles the case + // where we need to create a preceeding text node but there are + // no "slots" in textarray that we can steal from the current + // element. Therefore, we create a new textarray containing + // just the blank. When Tidy is fixed, this should be removed. + if (element.start >= element.end) + { + node.start = 0; + node.end = 1; + node.textarray = new byte[1]; + } + else + { + node.start = element.start++; + node.end = element.start; + node.textarray = element.textarray; + } + node.textarray[node.start] = (byte) ' '; Node.insertNodeBeforeElement(element, node); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |