Skip to content

Commit

Permalink
Merge pull request #24 from denghuafeng/master
Browse files Browse the repository at this point in the history
update: parse function type variable substringBeforeLast change subst…
  • Loading branch information
fivesmallq committed Mar 12, 2018
2 parents 7d70d64 + efe7386 commit f8fdd82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -48,7 +48,7 @@ public class ExtractorParser {
}

public static Extractor parse(String shortString) {
String type = StringUtils.substringBeforeLast(shortString, SPLIT_CHAR);
String type = StringUtils.substringBefore(shortString, SPLIT_CHAR);
Class extractorClass = extractorMap.get(type);
if (extractorClass == null) {
throw new ParseException("parse extractor error! unsupport extractor:'" + type + "'. string:'" + shortString + "'");
Expand Down
Expand Up @@ -63,4 +63,10 @@ public void testParseError() throws Exception {
String string = "json2:$..books";
ExtractorParser.parse(string);
}

@Test
public void testStringRangeParse() throws Exception {
String string = "stringRange:<li style=\"background: rgba(0, 0, 0, 0) none repeat scroll 0% 0%;\">,</li>";
ExtractorParser.parse(string);
}
}

0 comments on commit f8fdd82

Please sign in to comment.