Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes
In directory sc8-pr-cvs1:/tmp/cvs-serv3232/lexer/nodes
Modified Files:
RemarkNode.java
Log Message:
Handle some broken end tags.
Handle some pathological remark nodes.
Index: RemarkNode.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes/RemarkNode.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** RemarkNode.java 20 Oct 2003 01:28:02 -0000 1.8
--- RemarkNode.java 25 Oct 2003 15:46:02 -0000 1.9
***************
*** 55,63 ****
/**
* Returns the text contents of the comment tag.
- * todo: this only works for the usual case.
*/
public String getText()
{
! return (mPage.getText (elementBegin () + 4, elementEnd () - 3));
}
--- 55,73 ----
/**
* Returns the text contents of the comment tag.
*/
public String getText()
{
! int start;
! int end;
! String ret;
!
! start = elementBegin () + 4;
! end = elementEnd () - 3;
! if (start >= end)
! ret = "";
! else
! ret = mPage.getText (start, end);
!
! return (ret);
}
***************
*** 66,69 ****
--- 76,80 ----
return (getText());
}
+
public String toHtml() {
return (mPage.getText (elementBegin (), elementEnd ()));
|