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-18 01:41:20
|
Revision: 1211 http://jtidy.svn.sourceforge.net/jtidy/?rev=1211&view=rev Author: aditsu Date: 2010-11-18 01:41:14 +0000 (Thu, 18 Nov 2010) Log Message: ----------- fixed tests 647255 and 649812 - no need to call setXmlDecl for UTF16 encodings (encoding names starting with "Unicode") Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-18 01:15:32 UTC (rev 1210) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-18 01:41:14 UTC (rev 1211) @@ -442,7 +442,8 @@ // #427837 - fix by Dave Raggett 02 Jun 01 // generate <?xml version="1.0" encoding="iso-8859-1"?> if the output character encoding is Latin-1 etc. - if (!"UTF8".equals(getOutCharEncodingName()) && !"ASCII".equals(getOutCharEncodingName()) && isXmlOut()) { + if (!"UTF8".equals(getOutCharEncodingName()) && !"ASCII".equals(getOutCharEncodingName()) + && !getOutCharEncodingName().startsWith("Unicode") && isXmlOut()) { setXmlDecl(true); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-18 01:15:38
|
Revision: 1210 http://jtidy.svn.sourceforge.net/jtidy/?rev=1210&view=rev Author: aditsu Date: 2010-11-18 01:15:32 +0000 (Thu, 18 Nov 2010) Log Message: ----------- fixed test 586562 - added check for existing doctype in insertDocType 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-18 00:58:15 UTC (rev 1209) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java 2010-11-18 01:15:32 UTC (rev 1210) @@ -857,16 +857,18 @@ * @param element document * @param doctype doctype node to insert at the beginning of element */ - public static void insertDocType(Lexer lexer, Node element, Node doctype) - { - lexer.report.warning(lexer, element, doctype, ErrorCode.DOCTYPE_AFTER_TAGS); - - while (!element.is(TagId.HTML)) - { - element = element.parent; - } - - insertNodeBeforeElement(element, doctype); + public static void insertDocType(final Lexer lexer, Node element, final Node doctype) { + Node existing = lexer.root.findDocType(); + if (existing != null) { + lexer.report.warning(lexer, element, doctype, ErrorCode.DISCARDING_UNEXPECTED); + } + else { + lexer.report.warning(lexer, element, doctype, ErrorCode.DOCTYPE_AFTER_TAGS); + while (!element.is(TagId.HTML)) { + element = element.parent; + } + insertNodeBeforeElement(element, doctype); + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-18 00:58:23
|
Revision: 1209 http://jtidy.svn.sourceforge.net/jtidy/?rev=1209&view=rev Author: aditsu Date: 2010-11-18 00:58:15 +0000 (Thu, 18 Nov 2010) Log Message: ----------- fixed tests 566542 and 1086083 - added addClassNoIndent, addStyleAsClass and accessors for the DecorateInferredUL option; moved gensymClass to Lexer Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java 2010-11-17 23:53:53 UTC (rev 1208) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java 2010-11-18 00:58:15 UTC (rev 1209) @@ -93,11 +93,6 @@ private static final String XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; /** - * sequential number for generated css classes. - */ - private int classNum; - - /** * Tag table. */ private TagTable tt; @@ -288,26 +283,13 @@ } /** - * Generates a new css class name. - * @param lexer Lexer - * @return generated css class - */ - private String gensymClass(final Lexer lexer) { - String pfx = lexer.configuration.getCssPrefix(); - if (pfx == null) { - pfx = "c"; - } - return pfx + ++classNum; - } - - /** * Finds a css style. * @param lexer Lexer * @param tag tag name * @param properties css properties * @return style string */ - private String findStyle(Lexer lexer, String tag, String properties) + private static String findStyle(Lexer lexer, String tag, String properties) { Style style; @@ -319,10 +301,15 @@ } } - style = new Style(tag, gensymClass(lexer), properties, lexer.styles); + style = new Style(tag, lexer.gensymClass(), properties, lexer.styles); lexer.styles = style; return style.tagClass; } + + protected static void addStyleAsClass(final Lexer lexer, final Node node, final String stylevalue) { + final String classname = findStyle(lexer, node.element, stylevalue); + node.addClass(classname); + } /** * Find style attribute in node, and replace it by corresponding class attribute. Search for class in style Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-17 23:53:53 UTC (rev 1208) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-18 00:58:15 UTC (rev 1209) @@ -1284,4 +1284,12 @@ public void setPunctWrap(final boolean punctWrap) { set(Option.PunctWrap, punctWrap); } + + public boolean isDecorateInferredUL() { + return getBool(Option.DecorateInferredUL); + } + + public void setDecorateInferredUL(final boolean decorateInferredUL) { + set(Option.DecorateInferredUL, decorateInferredUL); + } } Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-11-17 23:53:53 UTC (rev 1208) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-11-18 00:58:15 UTC (rev 1209) @@ -383,6 +383,11 @@ private List<Node> nodeList; protected String givenDoctype; + + /** + * sequential number for generated css classes. + */ + private int classNum; /** * Instantiates a new Lexer. @@ -3896,4 +3901,30 @@ } return false; } + + protected void addClassNoIndent(final Node node) { + final String sprop = "padding-left: 2ex; margin-left: 0ex; margin-top: 0ex; margin-bottom: 0ex"; + if (!configuration.isDecorateInferredUL()) { + return; + } + if (configuration.isMakeClean()) { + Clean.addStyleAsClass(this, node, sprop); + } + else { + Clean.addStyleProperty(node, sprop); + } + } + + /** + * Generates a new css class name. + * @param lexer Lexer + * @return generated css class + */ + protected String gensymClass() { + String pfx = configuration.getCssPrefix(); + if (pfx == null) { + pfx = "c"; + } + return pfx + ++classNum; + } } Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-17 23:53:53 UTC (rev 1208) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-18 00:58:15 UTC (rev 1209) @@ -881,7 +881,7 @@ { lexer.ungetToken(); node = lexer.inferredTag(TagId.UL); - node.addClass("noindent"); + lexer.addClassNoIndent(node); lexer.excludeBlocks = true; } else if ((node.tag.model & Dict.CM_DEFLIST) != 0) @@ -2297,7 +2297,7 @@ { lexer.ungetToken(); node = lexer.inferredTag(TagId.UL); - node.addClass("noindent"); + lexer.addClassNoIndent(node); lexer.excludeBlocks = true; } else if ((node.tag.model & Dict.CM_DEFLIST) != 0) @@ -2382,7 +2382,7 @@ } node = lexer.inferredTag(TagId.UL); - node.addClass("noindent"); + lexer.addClassNoIndent(node); } else if ((node.tag.model & Dict.CM_DEFLIST) != 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-17 23:53:59
|
Revision: 1208 http://jtidy.svn.sourceforge.net/jtidy/?rev=1208&view=rev Author: aditsu Date: 2010-11-17 23:53:53 +0000 (Wed, 17 Nov 2010) Log Message: ----------- partial fix for test 445557 - modified encodingError to use decimal character values for invalid_char messages, and added special handling for characters between 127 and 160 in readChar Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/StreamInJavaImpl.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-17 23:46:35 UTC (rev 1207) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-17 23:53:53 UTC (rev 1208) @@ -480,21 +480,11 @@ break; case VENDOR_SPECIFIC_CHARS: lexer.badChars |= BC_VENDOR_SPECIFIC_CHARS; - messageLexer( - code.code(), - lexer, - Level.WARNING, - "invalid_char", - replaceMode, buf); + messageLexer(code.code(), lexer, Level.WARNING, "invalid_char", replaceMode, c); break; case INVALID_SGML_CHARS: lexer.badChars |= BC_INVALID_SGML_CHARS; - messageLexer( - code.code(), - lexer, - Level.WARNING, - "invalid_char", - replaceMode, buf); + messageLexer(code.code(), lexer, Level.WARNING, "invalid_char", replaceMode, c); break; case INVALID_UTF8: lexer.badChars |= BC_INVALID_UTF8; Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/StreamInJavaImpl.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/StreamInJavaImpl.java 2010-11-17 23:46:35 UTC (rev 1207) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/StreamInJavaImpl.java 2010-11-17 23:53:53 UTC (rev 1208) @@ -119,6 +119,8 @@ private int tabsize; private int tabs; + + private Lexer lexer; /** * Instantiates a new StreamInJavaImpl. @@ -259,6 +261,40 @@ return c; } } + + /* produced e.g. as a side-effect of smart quotes in Word */ + /* but can't happen if using MACROMAN encoding */ + if (127 < c && c < 160) { + int c1 = 0; + int replMode = Report.DISCARDED_CHAR; + final String enc = lexer.configuration.getInCharEncodingName(); + final String repl = lexer.configuration.getReplacementCharEncoding(); + boolean isVendorChar = ("WIN1252".equals(enc) || "MACROMAN".equals(enc)); + boolean isWinChar = ("WIN1252".equals(enc) || "WIN1252".equals(repl)); + boolean isMacChar = ("MACROMAN".equals(enc) || "MACROMAN".equals(repl)); + + /* set error position just before offending character */ + lexer.lines = curline; + lexer.columns = curcol; + + if (isWinChar) { + c1 = EncodingUtils.decodeWin1252(c); + } + else if (isMacChar) { + c1 = EncodingUtils.decodeMacRoman(c); + } + if (c1 != 0) { + replMode = Report.REPLACED_CHAR; + } + + if (c1 == 0 && isVendorChar) { + lexer.report.encodingError(lexer, ErrorCode.VENDOR_SPECIFIC_CHARS, c, replMode); + } + else if (!isVendorChar) { + lexer.report.encodingError(lexer, ErrorCode.INVALID_SGML_CHARS, c, replMode); + } + c = c1; + } this.curcol++; return c; @@ -333,9 +369,8 @@ /** * @see org.w3c.tidy.StreamIn#setLexer(org.w3c.tidy.Lexer) */ - public void setLexer(Lexer lexer) - { - // unused in the java implementation + public void setLexer(final Lexer lexer) { + this.lexer = lexer; } } \ 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: <ad...@us...> - 2010-11-17 23:46:41
|
Revision: 1207 http://jtidy.svn.sourceforge.net/jtidy/?rev=1207&view=rev Author: aditsu Date: 2010-11-17 23:46:35 +0000 (Wed, 17 Nov 2010) Log Message: ----------- improved diff handling and failure messages: added encodings for textual comparison; added line and column numbers; identified "end of file" situations 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-17 20:51:20 UTC (rev 1206) +++ branches/CodeUpdateAndJava5/src/test/java/org/w3c/tidy/TidyTester.java 2010-11-17 23:46:35 UTC (rev 1207) @@ -12,7 +12,9 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; import junit.framework.TestCase; @@ -61,7 +63,11 @@ } final ByteArrayOutputStream os = new ByteArrayOutputStream(); final ByteArrayOutputStream es = new ByteArrayOutputStream(); - tidy.setErrout(new PrintWriter(es)); + try { + tidy.setErrout(new PrintWriter(new OutputStreamWriter(es, "UTF-8"))); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } tidy.setInputStreamName(fname); tidy.parse(is, os); int x = tidy.getParseErrors() > 0 ? 2 : tidy.getParseWarnings() > 0 ? 1 : 0; @@ -74,16 +80,17 @@ } catch (IOException e) { os2 = new ByteArrayInputStream(new byte[0]); } - diff("outputs", new ByteArrayInputStream(os.toByteArray()), os2); + diff("outputs", new ByteArrayInputStream(os.toByteArray()), os2, tidy.getOutputEncoding()); diff("messages", new ByteArrayInputStream(es.toByteArray()), - new BufferedInputStream(new FileInputStream(base + "output/msg_" + t + ".txt"))); + new BufferedInputStream(new FileInputStream(base + "output/msg_" + t + ".txt")), "UTF-8"); } catch (IOException e) { throw new RuntimeException(e); } assertEquals(r, x); } - private static void diff(final String what, final InputStream s1, final InputStream s2) throws IOException { + private static void diff(final String what, final InputStream s1, final InputStream s2, + final String encoding) throws IOException { s1.mark(100000); s2.mark(100000); for (int x = 1; ; ++x) { @@ -100,22 +107,34 @@ } s1.reset(); s2.reset(); - final BufferedReader br1 = new BufferedReader(new InputStreamReader(s1)); - final BufferedReader br2 = new BufferedReader(new InputStreamReader(s2)); + final BufferedReader br1 = new BufferedReader(new InputStreamReader(s1, encoding)); + final BufferedReader br2 = new BufferedReader(new InputStreamReader(s2, encoding)); String l1 = ""; String l2 = ""; + int l = 0; while (true) { + ++l; l1 = br1.readLine(); l2 = br2.readLine(); if (l1 == null && l2 != null || !l1.equals(l2)) { break; } } - l1 += '\n' + br1.readLine(); - l2 += '\n' + br2.readLine(); + final String out1 = l1 == null ? "[end of file]" : l1 + '\n' + br1.readLine(); + final String out2 = l2 == null ? "[end of file]" : l2 + '\n' + br2.readLine(); br1.close(); br2.close(); - fail(what + " differ at byte " + x + ":\nExpected:\n" + l2 + "\nActual:\n" + l1); + int c = 0; + if (l1 != null && l2 != null) { + for (int i = 0; ; ++i) { + if (i >= l1.length() || i >= l2.length() || l1.charAt(i) != l2.charAt(i)) { + c = i + 1; + break; + } + } + } + fail(what + " differ at byte " + x + " (line " + l + " col " + c + "):\nExpected:\n" + out2 + + "\nActual:\n" + out1); } 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-17 20:51:26
|
Revision: 1206 http://jtidy.svn.sourceforge.net/jtidy/?rev=1206&view=rev Author: aditsu Date: 2010-11-17 20:51:20 +0000 (Wed, 17 Nov 2010) Log Message: ----------- fixed test 431964 - instead of using null for empty attribute values like Tidy does, and running into bug 3022414, modifying hasValue to return false for empty values seems to be a better solution Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/AttVal.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyUtils.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/AttVal.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/AttVal.java 2010-11-17 00:44:06 UTC (rev 1205) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/AttVal.java 2010-11-17 20:51:20 UTC (rev 1206) @@ -443,7 +443,7 @@ } public boolean hasValue() { - return value != null; + return value != null && value.length() > 0; } public boolean valueIs(final String val) { Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyUtils.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyUtils.java 2010-11-17 00:44:06 UTC (rev 1205) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/TidyUtils.java 2010-11-17 20:51:20 UTC (rev 1206) @@ -658,7 +658,6 @@ public static String getString(final byte[] bytes, final int offset, final int length) { try { return new String(bytes, offset, Math.min(length, bytes.length - offset), "UTF8"); - // FIXME use null for empty in tidy compatibility mode, required for test 431964 } catch (UnsupportedEncodingException e) { throw new Error("UTF-8 to string conversion failed: " + e.getMessage()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-11-17 00:44:12
|
Revision: 1205 http://jtidy.svn.sourceforge.net/jtidy/?rev=1205&view=rev Author: fgiust Date: 2010-11-17 00:44:06 +0000 (Wed, 17 Nov 2010) Log Message: ----------- updated test result Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/resources/427810.msg Modified: branches/CodeUpdateAndJava5/src/test/resources/427810.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/427810.msg 2010-11-17 00:43:29 UTC (rev 1204) +++ branches/CodeUpdateAndJava5/src/test/resources/427810.msg 2010-11-17 00:44:06 UTC (rev 1205) @@ -19,37 +19,39 @@ <code>21</code> <level>2</level> <line>9</line> - <column>2</column> + <column>1</column> <text><![CDATA[<wbr> is not approved by W3C]]></text> </message> <message> <code>21</code> <level>2</level> <line>10</line> - <column>2</column> + <column>1</column> <text><![CDATA[<nobr> is not approved by W3C]]></text> </message> <message> <code>111</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Document content looks like HTML proprietary]]></text> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[Document content looks like HTML Proprietary]]></text> </message> <message> <code>-1</code> <level>0</level> <line>0</line> <column>0</column> - <text><![CDATA[4 warnings, no errors were found!]]></text> + <text><![CDATA[4 warnings, 0 errors were found! +]]></text> </message> <message> <code>4</code> <level>0</level> - <line>1</line> - <column>1</column> + <line>0</line> + <column>0</column> <text><![CDATA[You are recommended to use CSS to control line wrapping. Use "white-space: nowrap" to inhibit wrapping in place -of inserting <NOBR>...</NOBR> into the markup.]]></text> +of inserting <NOBR>...</NOBR> into the markup. +]]></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-17 00:43:35
|
Revision: 1204 http://jtidy.svn.sourceforge.net/jtidy/?rev=1204&view=rev Author: fgiust Date: 2010-11-17 00:43:29 +0000 (Wed, 17 Nov 2010) Log Message: ----------- updated test result Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/resources/427677.msg Modified: branches/CodeUpdateAndJava5/src/test/resources/427677.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/427677.msg 2010-11-17 00:40:25 UTC (rev 1203) +++ branches/CodeUpdateAndJava5/src/test/resources/427677.msg 2010-11-17 00:43:29 UTC (rev 1204) @@ -10,16 +10,24 @@ </message> <message> <code>111</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Document content looks like HTML 4.01]]></text> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[Document content looks like HTML 4.01 Strict]]></text> </message> <message> <code>-1</code> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[No system identifier in emitted doctype]]></text> + </message> + <message> + <code>-1</code> <level>0</level> <line>0</line> <column>0</column> - <text><![CDATA[1 warning, no errors were found!]]></text> + <text><![CDATA[1 warning, 0 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-17 00:40:31
|
Revision: 1203 http://jtidy.svn.sourceforge.net/jtidy/?rev=1203&view=rev Author: fgiust Date: 2010-11-17 00:40:25 +0000 (Wed, 17 Nov 2010) Log Message: ----------- updated test result Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/resources/427676.msg Modified: branches/CodeUpdateAndJava5/src/test/resources/427676.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/427676.msg 2010-11-17 00:39:43 UTC (rev 1202) +++ branches/CodeUpdateAndJava5/src/test/resources/427676.msg 2010-11-17 00:40:25 UTC (rev 1203) @@ -12,28 +12,28 @@ <code>59</code> <level>2</level> <line>6</line> - <column>15</column> + <column>14</column> <text><![CDATA[<spanstyle> unexpected or duplicate quote mark]]></text> </message> <message> <code>58</code> <level>2</level> <line>6</line> - <column>15</column> + <column>14</column> <text><![CDATA[<spanstyle> attribute with missing trailing quote mark]]></text> </message> <message> <code>22</code> <level>3</level> <line>6</line> - <column>15</column> + <column>14</column> <text><![CDATA[<spanstyle> is not recognized!]]></text> </message> <message> <code>8</code> <level>2</level> <line>6</line> - <column>15</column> + <column>14</column> <text><![CDATA[discarding unexpected <spanstyle>]]></text> </message> <message> @@ -47,22 +47,23 @@ <code>59</code> <level>2</level> <line>6</line> - <column>53</column> + <column>52</column> <text><![CDATA[<a> unexpected or duplicate quote mark]]></text> </message> <message> <code>111</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Document content looks like HTML 2.0]]></text> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[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, 1 error were found!]]></text> + <text><![CDATA[6 warnings, 1 error were found! +]]></text> </message> <message> <code>-1</code> @@ -70,6 +71,7 @@ <line>0</line> <column>0</column> <text><![CDATA[This document has errors that must be fixed before -using HTML Tidy to generate a tidied up version.]]></text> +using HTML Tidy to generate a tidied up version. +]]></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-17 00:39:49
|
Revision: 1202 http://jtidy.svn.sourceforge.net/jtidy/?rev=1202&view=rev Author: fgiust Date: 2010-11-17 00:39:43 +0000 (Wed, 17 Nov 2010) Log Message: ----------- updated test result Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/resources/427672.msg branches/CodeUpdateAndJava5/src/test/resources/427675.msg Modified: branches/CodeUpdateAndJava5/src/test/resources/427672.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/427672.msg 2010-11-17 00:37:55 UTC (rev 1201) +++ branches/CodeUpdateAndJava5/src/test/resources/427672.msg 2010-11-17 00:39:43 UTC (rev 1202) @@ -9,24 +9,25 @@ <text><![CDATA[missing <!DOCTYPE> declaration]]></text> </message> <message> - <code>51</code> + <code>72</code> <level>2</level> <line>5</line> <column>1</column> - <text><![CDATA[<body> attribute "Ã1/2" has invalid value "xx"]]></text> + <text><![CDATA[<body> attribute name "Ã1/2" (value="xx") is invalid]]></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> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[Document content looks like HTML 3.2]]></text> </message> <message> <code>-1</code> <level>0</level> <line>0</line> <column>0</column> - <text><![CDATA[2 warnings, no errors were found!]]></text> + <text><![CDATA[2 warnings, 0 errors were found! +]]></text> </message> </messages> Modified: branches/CodeUpdateAndJava5/src/test/resources/427675.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/427675.msg 2010-11-17 00:37:55 UTC (rev 1201) +++ branches/CodeUpdateAndJava5/src/test/resources/427675.msg 2010-11-17 00:39:43 UTC (rev 1202) @@ -18,22 +18,30 @@ <message> <code>6</code> <level>2</level> - <line>11</line> - <column>2</column> + <line>10</line> + <column>1</column> <text><![CDATA[missing </noframes>]]></text> </message> <message> <code>111</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Document content looks like HTML 4.01 Frameset]]></text> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[Document content looks like HTML 4.01 Frameset]]></text> </message> <message> <code>-1</code> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[No system identifier in emitted doctype]]></text> + </message> + <message> + <code>-1</code> <level>0</level> <line>0</line> <column>0</column> - <text><![CDATA[3 warnings, no errors were found!]]></text> + <text><![CDATA[3 warnings, 0 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-17 00:38:01
|
Revision: 1201 http://jtidy.svn.sourceforge.net/jtidy/?rev=1201&view=rev Author: fgiust Date: 2010-11-17 00:37:55 +0000 (Wed, 17 Nov 2010) Log Message: ----------- updated test result Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/resources/427671.msg Modified: branches/CodeUpdateAndJava5/src/test/resources/427671.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/427671.msg 2010-11-17 00:37:30 UTC (rev 1200) +++ branches/CodeUpdateAndJava5/src/test/resources/427671.msg 2010-11-17 00:37:55 UTC (rev 1201) @@ -66,16 +66,17 @@ </message> <message> <code>111</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Document content looks like HTML proprietary]]></text> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[Document content looks like HTML Proprietary]]></text> </message> <message> <code>-1</code> <level>0</level> <line>0</line> <column>0</column> - <text><![CDATA[9 warnings, no errors were found!]]></text> + <text><![CDATA[9 warnings, 0 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-17 00:37:36
|
Revision: 1200 http://jtidy.svn.sourceforge.net/jtidy/?rev=1200&view=rev Author: fgiust Date: 2010-11-17 00:37:30 +0000 (Wed, 17 Nov 2010) Log Message: ----------- updated test result Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/resources/427664.msg Modified: branches/CodeUpdateAndJava5/src/test/resources/427664.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/427664.msg 2010-11-17 00:37:00 UTC (rev 1199) +++ branches/CodeUpdateAndJava5/src/test/resources/427664.msg 2010-11-17 00:37:30 UTC (rev 1200) @@ -9,11 +9,11 @@ <text><![CDATA[missing <!DOCTYPE> declaration]]></text> </message> <message> - <code>51</code> + <code>72</code> <level>2</level> <line>5</line> <column>1</column> - <text><![CDATA[<body> attribute "Ã1/2" has invalid value "xx"]]></text> + <text><![CDATA[<body> attribute name "Ã1/2" (value="xx") is invalid]]></text> </message> <message> <code>59</code> @@ -37,17 +37,25 @@ <text><![CDATA[<body> attribute "width" has invalid value "align="""]]></text> </message> <message> - <code>111</code> - <level>0</level> - <line>1</line> + <code>53</code> + <level>2</level> + <line>5</line> <column>1</column> - <text><![CDATA[InputStream: Document content looks like HTML 3.2]]></text> + <text><![CDATA[<body> proprietary attribute "width"]]></text> </message> <message> + <code>111</code> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[Document content looks like HTML Proprietary]]></text> + </message> + <message> <code>-1</code> <level>0</level> <line>0</line> <column>0</column> - <text><![CDATA[5 warnings, no errors were found!]]></text> + <text><![CDATA[6 warnings, 0 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-17 00:37:06
|
Revision: 1199 http://jtidy.svn.sourceforge.net/jtidy/?rev=1199&view=rev Author: fgiust Date: 2010-11-17 00:37:00 +0000 (Wed, 17 Nov 2010) Log Message: ----------- updated test result Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/resources/427633.msg Modified: branches/CodeUpdateAndJava5/src/test/resources/427633.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/427633.msg 2010-11-17 00:34:56 UTC (rev 1198) +++ branches/CodeUpdateAndJava5/src/test/resources/427633.msg 2010-11-17 00:37:00 UTC (rev 1199) @@ -10,17 +10,17 @@ </message> <message> <code>111</code> - <level>0</level> - <line>1</line> - <column>1</column> - <text><![CDATA[InputStream: Document content looks like HTML 2.0]]></text> + <level>1</level> + <line>0</line> + <column>0</column> + <text><![CDATA[Document content looks like HTML 3.2]]></text> </message> <message> <code>-1</code> <level>0</level> <line>0</line> <column>0</column> - <text><![CDATA[1 warning, no errors were found! + <text><![CDATA[1 warning, 0 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-17 00:35:02
|
Revision: 1198 http://jtidy.svn.sourceforge.net/jtidy/?rev=1198&view=rev Author: fgiust Date: 2010-11-17 00:34:56 +0000 (Wed, 17 Nov 2010) Log Message: ----------- updated test result Modified Paths: -------------- branches/CodeUpdateAndJava5/src/test/resources/1003994.msg Modified: branches/CodeUpdateAndJava5/src/test/resources/1003994.msg =================================================================== --- branches/CodeUpdateAndJava5/src/test/resources/1003994.msg 2010-11-15 15:09:23 UTC (rev 1197) +++ branches/CodeUpdateAndJava5/src/test/resources/1003994.msg 2010-11-17 00:34:56 UTC (rev 1198) @@ -5,7 +5,7 @@ <code>13</code> <level>2</level> <line>1</line> - <column>-3</column> + <column>1</column> <text><![CDATA[unexpected </foo>]]></text> </message> <message> @@ -13,6 +13,7 @@ <level>0</level> <line>0</line> <column>0</column> - <text><![CDATA[1 warning, no errors were found!]]></text> + <text><![CDATA[1 warning, 0 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: <ad...@us...> - 2010-11-15 15:09:29
|
Revision: 1197 http://jtidy.svn.sourceforge.net/jtidy/?rev=1197&view=rev Author: aditsu Date: 2010-11-15 15:09:23 +0000 (Mon, 15 Nov 2010) Log Message: ----------- fixed test 511679 - automatically close <pre> when closing ancestor tags 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-15 14:17:00 UTC (rev 1196) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-15 15:09:23 UTC (rev 1197) @@ -1914,10 +1914,12 @@ lexer.inlineDup(null); // tell lexer to insert inlines if needed - while ((node = lexer.getToken(Lexer.PREFORMATTED)) != null) - { - if (node.tag == pre.tag && node.type == NodeType.EndTag) - { + while ((node = lexer.getToken(Lexer.PREFORMATTED)) != null) { + if (node.type == NodeType.EndTag && (node.tag == pre.tag || pre.isDescendantOf(node.getId()))) { + if (node.tag != pre.tag) { + lexer.report.warning(lexer, pre, node, ErrorCode.MISSING_ENDTAG_BEFORE); + lexer.ungetToken(); + } Node.trimSpaces(lexer, pre); pre.closed = true; return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-15 14:17:12
|
Revision: 1196 http://jtidy.svn.sourceforge.net/jtidy/?rev=1196&view=rev Author: aditsu Date: 2010-11-15 14:17:00 +0000 (Mon, 15 Nov 2010) Log Message: ----------- fixed test 1027888 - replaced mergeDivs with mergeNestedElements (called for spans too), and added copyAttrs Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/AttVal.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/AttVal.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/AttVal.java 2010-11-15 13:11:37 UTC (rev 1195) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/AttVal.java 2010-11-15 14:17:00 UTC (rev 1196) @@ -458,6 +458,10 @@ return dict != null && dict.id == id; } + protected AttrId getId() { + return dict != null ? dict.id : AttrId.UNKNOWN; + } + protected static AttVal addAttrToList(final AttVal list, final AttVal av) { if (list == null) { return av; Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java 2010-11-15 13:11:37 UTC (rev 1195) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java 2010-11-15 14:17:00 UTC (rev 1196) @@ -1166,24 +1166,69 @@ return false; } - /** - * Symptom: <code><div><div>...</div></div></code> Action: merge the two divs. This is useful after - * nested <dir>s used by Word for indenting have been converted to <div>s. - * @param lexer Lexer - * @param node first div - * @return true if the divs have been merged - */ - private boolean mergeDivs(final Lexer lexer, final Node node, final TriState state) { - if (state == TriState.No || !node.is(TagId.DIV)) { + /* Copy child attributes to node. Duplicate attributes are overwritten. + Unique attributes (such as ID) disable the action. + Attributes style and class are not dealt with. A call to MergeStyles + will do that. + */ + private boolean copyAttrs(final Node node, final Node child) { + /* Detect attributes that cannot be merged or overwritten. */ + if (child.getAttrById(AttrId.ID) != null && node.getAttrById(AttrId.ID) != null) { + return false; + } + + /* Move child attributes to node. Attributes in node + can be overwritten or merged. */ + for (AttVal av2 = child.attributes; av2 != null; ) { + /* Dealt by MergeStyles. */ + if (av2.is(AttrId.STYLE) || av2.is(AttrId.CLASS)) { + av2 = av2.next; + continue; + } + /* Avoid duplicates in node */ + final AttrId id = av2.getId(); + AttVal av1; + if (id != AttrId.UNKNOWN && (av1 = node.getAttrById(id)) != null) { + node.removeAttribute(av1); + } + + /* Move attribute from child to node */ + child.removeAttribute(av2); + av1 = av2; + av2 = av2.next; + av1.next = null; + node.insertAttributeAtEnd(av1); + } + return true; + } + + /* + Symptom <XX><XX>...</XX></XX> + Action: merge the two XXs + + For instance, this is useful after nested <dir>s used by Word + for indenting have been converted to <div>s + + If state is "no", no merging. + If state is "yes", inner element is discarded. Only Style and Class + attributes are merged using MergeStyles(). + If state is "auto", atttibutes are merged as described in CopyAttrs(). + Style and Class attributes are merged using MergeStyles(). + */ + private boolean mergeNestedElements(final TagId id, final TriState state, final Node node) { + if (state == TriState.No || !node.is(id)) { return false; } final Node child = node.content; - if (child == null || child.next != null || !child.is(TagId.DIV)) { + if (child == null || child.next != null || !child.is(id)) { return false; } + if (state == TriState.Auto && !copyAttrs(node, child)) { + return false; + } mergeStyles(node, child); stripOnlyChild(node); return true; @@ -1504,6 +1549,7 @@ Node[] o = new Node[1]; boolean b = false; final TriState mergeDivs = lexer.configuration.getMergeDivs(); + final TriState mergeSpans = lexer.configuration.getMergeSpans(); for (next = node; node != null && node.isElement(); node = next) { @@ -1532,13 +1578,14 @@ continue; } - b = mergeDivs(lexer, node, mergeDivs); - next = o[0]; - if (b) - { + if (mergeNestedElements(TagId.DIV, mergeDivs, node)) { continue; } + if (mergeNestedElements(TagId.SPAN, mergeSpans, node)) { + continue; + } + b = blockStyle(lexer, node); next = o[0]; if (b) Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-15 13:11:37 UTC (rev 1195) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Configuration.java 2010-11-15 14:17:00 UTC (rev 1196) @@ -1253,6 +1253,14 @@ return (TriState) getOptionEnum(Option.MergeDivs); } + protected void setMergeSpans(final TriState mergeSpans) { + set(Option.MergeSpans, mergeSpans); + } + + protected TriState getMergeSpans() { + return (TriState) getOptionEnum(Option.MergeSpans); + } + protected void setTidyCompat(final boolean tidyCompat) { set(Option.TidyCompat, tidyCompat); } Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java 2010-11-15 13:11:37 UTC (rev 1195) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java 2010-11-15 14:17:00 UTC (rev 1196) @@ -386,33 +386,20 @@ } } + protected void insertAttributeAtEnd(final AttVal av) { + attributes = AttVal.addAttrToList(attributes, av); + } + /** * Adds an attribute to the node. * @param name attribute name * @param value attribute value * @return */ - public AttVal addAttribute(String name, String value) - { - AttVal av = new AttVal(null, null, null, null, '"', name, value); + public AttVal addAttribute(final String name, final String value) { + final AttVal av = new AttVal(null, null, null, null, '"', name, value); av.dict = AttributeTable.getDefaultAttributeTable().findAttribute(av); - - if (this.attributes == null) - { - this.attributes = av; - } - else - { - // append to end of attributes - AttVal here = this.attributes; - - while (here.next != null) - { - here = here.next; - } - - here.next = av; - } + insertAttributeAtEnd(av); return av; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-15 13:11:43
|
Revision: 1195 http://jtidy.svn.sourceforge.net/jtidy/?rev=1195&view=rev Author: aditsu Date: 2010-11-15 13:11:37 +0000 (Mon, 15 Nov 2010) Log Message: ----------- fixed test 1014993 - using "NULL" for null attribute names/values in attrError 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-15 12:59:54 UTC (rev 1194) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-15 13:11:37 UTC (rev 1195) @@ -551,8 +551,8 @@ } final String tagdesc = getTagName(node); - final String name = attribute == null ? null : attribute.attribute; - final String value = attribute == null ? null : attribute.value; + final String name = attribute == null || attribute.attribute == null ? "NULL" : attribute.attribute; + final String value = attribute == null || attribute.value == null ? "NULL" : attribute.value; switch (code) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-15 13:00:00
|
Revision: 1194 http://jtidy.svn.sourceforge.net/jtidy/?rev=1194&view=rev Author: aditsu Date: 2010-11-15 12:59:54 +0000 (Mon, 15 Nov 2010) Log Message: ----------- fixed test 487204 - updated and simplified bQ2Div Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java 2010-11-15 12:44:12 UTC (rev 1193) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Clean.java 2010-11-15 12:59:54 UTC (rev 1194) @@ -1737,15 +1737,11 @@ */ public void bQ2Div(Node node) { - int indent; - String indentBuf; - AttVal attval; - while (node != null) { if (node.is(TagId.BLOCKQUOTE) && node.implicit) { - indent = 1; + int indent = 1; while (node.hasOneChild() && node.content.is(TagId.BLOCKQUOTE) && node.implicit) { @@ -1758,20 +1754,10 @@ bQ2Div(node.content); } - indentBuf = "margin-left: " + (new Integer(2 * indent)).toString() + "em"; + String indentBuf = "margin-left: " + 2 * indent + "em"; renameElem(node, TagId.DIV); - - attval = node.getAttrByName("style"); - - if (attval != null && attval.value != null) - { - attval.value = indentBuf + "; " + attval.value; - } - else - { - node.addAttribute("style", indentBuf); - } + addStyleProperty(node, indentBuf); } else if (node.content != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-15 12:44:18
|
Revision: 1193 http://jtidy.svn.sourceforge.net/jtidy/?rev=1193&view=rev Author: aditsu Date: 2010-11-15 12:44:12 +0000 (Mon, 15 Nov 2010) Log Message: ----------- fixed test 480701 - removed extra line after xml comment 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-15 12:31:20 UTC (rev 1192) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java 2010-11-15 12:44:12 UTC (rev 1193) @@ -2230,7 +2230,7 @@ { condFlushLine(fout, indent); printComment(lexer, fout, 0, node); - condFlushLine(fout, 0); +// condFlushLine(fout, 0); } else if (node.type == NodeType.RootNode) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-15 12:31:27
|
Revision: 1192 http://jtidy.svn.sourceforge.net/jtidy/?rev=1192&view=rev Author: aditsu Date: 2010-11-15 12:31:20 +0000 (Mon, 15 Nov 2010) Log Message: ----------- replaced null with Level.SUMMARY in the remaining places 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-15 11:32:45 UTC (rev 1191) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-15 12:31:20 UTC (rev 1192) @@ -373,7 +373,7 @@ * @param p printWriter */ public void showVersion(final PrintWriter p) { - printMessage(p, null, "version_summary", RELEASE_DATE_STRING); + printMessage(p, Level.SUMMARY, "version_summary", RELEASE_DATE_STRING); } /** @@ -1035,7 +1035,7 @@ */ public void generalInfo(PrintWriter errout) { - printMessage(errout, null, "general_info"); + printMessage(errout, Level.SUMMARY, "general_info"); } /** @@ -1095,7 +1095,7 @@ */ public void helpText(PrintWriter out) { - printMessage(out, null, "help_text", "Tidy", RELEASE_DATE_STRING); + printMessage(out, Level.SUMMARY, "help_text", "Tidy", RELEASE_DATE_STRING); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-15 11:32:51
|
Revision: 1191 http://jtidy.svn.sourceforge.net/jtidy/?rev=1191&view=rev Author: aditsu Date: 2010-11-15 11:32:45 +0000 (Mon, 15 Nov 2010) Log Message: ----------- removed bad command-line alias Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java trunk/jtidy/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-15 10:02:58 UTC (rev 1190) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Tidy.java 2010-11-15 11:32:45 UTC (rev 1191) @@ -101,7 +101,6 @@ static { CMDLINE_ALIAS.put("xml", "input-xml"); - CMDLINE_ALIAS.put("xml", "output-xhtml"); CMDLINE_ALIAS.put("asxml", "output-xhtml"); CMDLINE_ALIAS.put("asxhtml", "output-xhtml"); CMDLINE_ALIAS.put("ashtml", "output-html"); Modified: trunk/jtidy/src/main/java/org/w3c/tidy/Tidy.java =================================================================== --- trunk/jtidy/src/main/java/org/w3c/tidy/Tidy.java 2010-11-15 10:02:58 UTC (rev 1190) +++ trunk/jtidy/src/main/java/org/w3c/tidy/Tidy.java 2010-11-15 11:32:45 UTC (rev 1191) @@ -92,7 +92,6 @@ static { CMDLINE_ALIAS.put("xml", "input-xml"); - CMDLINE_ALIAS.put("xml", "output-xhtml"); CMDLINE_ALIAS.put("asxml", "output-xhtml"); CMDLINE_ALIAS.put("asxhtml", "output-xhtml"); CMDLINE_ALIAS.put("ashtml", "output-html"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-15 11:08:25
|
Revision: 1189 http://jtidy.svn.sourceforge.net/jtidy/?rev=1189&view=rev Author: aditsu Date: 2010-11-15 09:49:08 +0000 (Mon, 15 Nov 2010) Log Message: ----------- restored the old position for NESTED_EMPHASIS when not in Tidy compatibility mode (it looks more appropriate) 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-15 08:58:38 UTC (rev 1188) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-15 09:49:08 UTC (rev 1189) @@ -700,8 +700,13 @@ messageLexer(lexer, Level.WARNING, code, getTagName(element), getTagName(node)); break; - case NESTED_EMPHASIS : - messageNode(lexer, Level.WARNING, rpt, code, nodedesc); + case NESTED_EMPHASIS: + if (lexer.configuration.isTidyCompat()) { + messageNode(lexer, Level.WARNING, rpt, code, nodedesc); + } + else { + messageLexer(lexer, Level.WARNING, code, nodedesc); + } break; case MISSING_STARTTAG : This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-15 11:08:14
|
Revision: 1190 http://jtidy.svn.sourceforge.net/jtidy/?rev=1190&view=rev Author: aditsu Date: 2010-11-15 10:02:58 +0000 (Mon, 15 Nov 2010) Log Message: ----------- fixed test 1426419 - handling of inline elements closed in the wrong order Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-11-15 09:49:08 UTC (rev 1189) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-11-15 10:02:58 UTC (rev 1190) @@ -1595,6 +1595,7 @@ } // at start of block elements, unclosed inline + // elements are inserted into the token stream if (this.insert != -1 || this.inode != null) { return insertedToken(); @@ -3835,4 +3836,64 @@ } return false; } + + /* + We have two CM_INLINE elements pushed ... the first is closing, + but, like the browser, the second should be retained ... + Like <b>bold <i>bold and italics</b> italics only</i> + This function switches the tag positions on the stack, + returning true if both were found in the expected order. + */ + protected boolean switchInline(final Node element, final Node node) { + if (element != null && element.tag != null + && node != null && node.tag != null + && isPushed(element) && isPushed(node) + && istack.size() - istackbase >= 2) { + /* we have a chance of succeeding ... */ + for (int i = (istack.size() - istackbase - 1); i >= 0; --i) { + if (istack.get(i).tag == element.tag) { + /* found the element tag - phew */ + int istack1 = i; + int istack2 = -1; + --i; /* back one more, and continue */ + for ( ; i >= 0; --i) { + if (istack.get(i).tag == node.tag) { + /* found the element tag - phew */ + istack2 = i; + break; + } + } + if (istack2 >= 0) { + /* perform the swap */ + IStack tmp = istack.get(istack2); + istack.set(istack2, istack.get(istack1)); + istack.set(istack1, tmp); + return true; + } + } + } + } + return false; + } + + /* + We want to push a specific a specific element on the stack, + but it may not be the last element, which InlineDup() + would handle. Return true if found and inserted. + */ + protected boolean inlineDup1(final Node node, final Node element) { + int n; + if (element != null && element.tag != null + && ((n = istack.size() - istackbase) > 0)) { + for (int i = n - 1; i >=0; --i ) { + if (istack.get(i).tag == element.tag) { + /* found our element tag - insert it */ + insert = i; + inode = node; + return true; + } + } + } + return false; + } } Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-15 09:49:08 UTC (rev 1189) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-15 10:02:58 UTC (rev 1190) @@ -1286,11 +1286,27 @@ continue; } } - else if ((node.tag.model & Dict.CM_INLINE) != 0 - && !node.is(TagId.A) - && !((node.tag.model & Dict.CM_OBJECT) != 0) - && (element.tag.model & Dict.CM_INLINE) != 0) - { + else if (node.hasCM(Dict.CM_INLINE) && !node.is(TagId.A) + && !node.hasCM(Dict.CM_OBJECT) && element.hasCM(Dict.CM_INLINE)) { + /* retain an earlier inline element. + This is implemented by setting the lexer into a mode + where it gets tokens from the inline stack rather than + from the input stream. Check if the scenerio fits. */ + if (!element.is(TagId.A) && node.tag != element.tag + && lexer.isPushed(node) && lexer.isPushed(element)) { + /* we have something like + <b>bold <i>bold and italic</b> italics</i> */ + if (lexer.switchInline(element, node)) { + lexer.report.warning(lexer, element, node, ErrorCode.NON_MATCHING_ENDTAG); + lexer.ungetToken(); /* put this back */ + lexer.inlineDup1(null, element); /* dupe the <i>, after </b> */ + if ((mode & Lexer.PREFORMATTED) == 0) { + Node.trimSpaces(lexer, element); + } + return; /* close <i>, but will re-open it, after </b> */ + } + } + // allow any inline end tag to end current element lexer.popInline(element); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-15 08:58:44
|
Revision: 1188 http://jtidy.svn.sourceforge.net/jtidy/?rev=1188&view=rev Author: aditsu Date: 2010-11-15 08:58:38 +0000 (Mon, 15 Nov 2010) Log Message: ----------- fixed test 1062511 - adjusted NON_MATCHING_ENDTAG handling (only in Tidy compatibility mode, because it looks wrong) 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 21:24:53 UTC (rev 1187) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-15 08:58:38 UTC (rev 1188) @@ -746,8 +746,13 @@ messageNode(lexer, Level.WARNING, rpt, code, element.element); break; - case NON_MATCHING_ENDTAG : - messageLexer(lexer, Level.WARNING, code, getTagName(node), element.element); + case NON_MATCHING_ENDTAG: + if (lexer.configuration.isTidyCompat()) { + messageNode(lexer, Level.WARNING, rpt, code, node.element, node.element); + } + else { + messageLexer(lexer, Level.WARNING, code, nodedesc, element.element); + } break; case MISSING_DOCTYPE: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2010-11-13 21:24:59
|
Revision: 1187 http://jtidy.svn.sourceforge.net/jtidy/?rev=1187&view=rev Author: aditsu Date: 2010-11-13 21:24:53 +0000 (Sat, 13 Nov 2010) Log Message: ----------- fixed test 1638062 - added additional conditions for coercing a node to endtag, also moved textNodeEndWithSpace to Lexer and fixed the NESTED_EMPHASIS warning Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-11-13 20:44:58 UTC (rev 1186) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Lexer.java 2010-11-13 21:24:53 UTC (rev 1187) @@ -3814,11 +3814,25 @@ return null; } - public Node findXmlDecl() { + protected Node findXmlDecl() { Node node = root.content; while (node != null && node.type != NodeType.XmlDecl) { node = node.next; } return node; } + + protected boolean textNodeEndWithSpace(final Node node) { + if (node.isText() && node.end > node.start) { + int i, c = '\0'; /* initialised to avoid warnings */ + for (i = node.start; i < node.end; ++i) { + c = lexbuf[i] & 0xFF; // Convert to unsigned. + } + + if (c == ' ' || c == '\n') { + return true; + } + } + return false; + } } Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java 2010-11-13 20:44:58 UTC (rev 1186) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/PPrint.java 2010-11-13 21:24:53 UTC (rev 1187) @@ -1263,20 +1263,6 @@ } } - private static boolean textNodeEndWithSpace(final Lexer lexer, final Node node) { - if (node.isText() && node.end > node.start) { - int i, c = '\0'; /* initialised to avoid warnings */ - for (i = node.start; i < node.end; ++i) { - c = lexer.lexbuf[i] & 0xFF; // Convert to unsigned. - } - - if (c == ' ' || c == '\n') { - return true; - } - } - return false; - } - /* Line can be wrapped immediately after inline start tag provided if follows a text node ending in a space, or it follows a <br>, @@ -1298,7 +1284,7 @@ Node prev = node.prev; if (prev != null) { if (prev.isText()) { - return textNodeEndWithSpace(lexer, prev); + return lexer.textNodeEndWithSpace(prev); } else if (prev.is(TagId.BR)) { return true; } Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-13 20:44:58 UTC (rev 1186) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/ParserImpl.java 2010-11-13 21:24:53 UTC (rev 1187) @@ -1185,8 +1185,8 @@ && !node.is(TagId.SMALL) && !node.is(TagId.Q)) { - if (element.content != null && node.attributes == null) - { + if (element.content != null && node.attributes == null + && element.last.isText() && !lexer.textNodeEndWithSpace(element.last)) { lexer.report.warning(lexer, element, node, ErrorCode.COERCE_TO_ENDTAG); node.type = NodeType.EndTag; lexer.ungetToken(); 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:44:58 UTC (rev 1186) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Report.java 2010-11-13 21:24:53 UTC (rev 1187) @@ -701,7 +701,7 @@ break; case NESTED_EMPHASIS : - messageLexer(lexer, Level.INFO, code, getTagName(node)); + messageNode(lexer, Level.WARNING, rpt, code, nodedesc); break; case MISSING_STARTTAG : This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |