Skip to content

Commit

Permalink
Merge pull request #433 from darkv/template_parser_patch
Browse files Browse the repository at this point in the history
Template parser patch
  • Loading branch information
Chuck Hill committed Jun 30, 2013
2 parents f3e41dc + fae5beb commit 259db40
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class WOHelperFunctionHTMLParser {
private static final String WO_COLON_END_TAG = "</wo:";
private static final String WO_COLON_START_TAG = "<wo:";
private static final String WO_REPLACEMENT_MARKER = "__REPL__";
private static final String XML_CDATA_START_TAG = "<![CDATA[";

private static boolean _parseStandardTags = false;
private NSMutableDictionary _stackDict;
Expand Down Expand Up @@ -173,13 +174,18 @@ else if (token.startsWith("<!--") && flag) {
* @return a rewritten token if it has an inline binding or a closing tag, if it belongs to a rewritten token
*/
private String checkToken(String token) {
if (token == null) {
return token;
}
String tokenLowerCase = token.toLowerCase();
if (tokenLowerCase.startsWith(WEBOBJECT_START_TAG) || tokenLowerCase.startsWith(WO_COLON_START_TAG) || tokenLowerCase.startsWith(WO_START_TAG)
|| tokenLowerCase.startsWith(XML_CDATA_START_TAG)) {
// we return immediately, if it is a webobject token or CDATA tag
return token;
}

String original = new String(token);
try {
if (token == null || token.toLowerCase().startsWith(WEBOBJECT_START_TAG) || token.toLowerCase().startsWith(WO_COLON_START_TAG) || token.toLowerCase().startsWith(WO_START_TAG) ) {
// we return immediately, if it is a webobject token
return token;
}

String[] tokenParts = token.split(" ");
String tokenPart = tokenParts[0].substring(1);

Expand Down

0 comments on commit 259db40

Please sign in to comment.