You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sv...@apache.org on 2005/08/24 00:38:12 UTC
svn commit: r239471 -
/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java
Author: svieujot
Date: Tue Aug 23 15:38:09 2005
New Revision: 239471
URL: http://svn.apache.org/viewcvs?rev=239471&view=rev
Log:
inputHtml : getHtmlBody fixes for html texts without body.
Modified:
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java?rev=239471&r1=239470&r2=239471&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java Tue Aug 23 15:38:09 2005
@@ -364,8 +364,13 @@
|| bodyStartIndex > bodyEndIndex
|| bodyStartIndex>=textLength || bodyEndIndex>=textLength ){
- if( lcText.indexOf("<body/>")==-1 || lcText.indexOf("<body />")==-1 )
+ if( lcText.indexOf("<body/>")!=-1 || lcText.indexOf("<body />")!=-1 )
return "";
+
+ int htmlStartIndex = lcText.indexOf("<html>");
+ int htmlEndIndex = lcText.indexOf("</html>");
+ if( htmlStartIndex != -1 && htmlEndIndex > htmlStartIndex )
+ return html.substring(htmlStartIndex+6, htmlEndIndex);
log.warn("Couldn't extract HTML body from :\n"+html);
return html.trim();