From: SourceForge.net <no...@so...> - 2010-09-01 11:15:21
|
Bugs item #3057375, was opened at 2010-09-01 13:15 Message generated for change (Tracker Item Submitted) made by rmacnell You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3057375&group_id=13153 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Tidy functionality Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Robert Mac Nelly (rmacnell) Assigned to: Nobody/Anonymous (nobody) Summary: NullPointerException in PPrint.printText Initial Comment: Tidy creates a TextNode without any content if there is an inline element starting with whitespace after another element (block or inline) Example: <div>foo</div><span> bar</span> Tidy creates: [Node type=StartTag,element=div,content= [Node type=TextNode,element=null,text="foo",content=null] ], [Node type=TextNode,element=null,text=null,content=null], [Node type=StartTag,element=span,content= [Node type=TextNode,element=null,text="bar",content=null] ] ] In Method PPrint.printText node.textarray is null and c = (textarray[i]) & 0xFF; raises a NullPointerException I added following workaround to PPrint.printTree: if (node.type == Node.TEXT_NODE || (node.type == Node.CDATA_TAG && lexer.configuration.escapeCdata)) { if(null==node.textarray)return; //WORKAROUND printText(fout, mode, indent, node.textarray, node.start, node.end); } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3057375&group_id=13153 |