Merge pull request #145 from vonrosen/ARI-4713

Make some urls with whitespace acceptable to JavaScript extractor.
This commit is contained in:
Hunter
2016-02-11 08:27:52 -08:00
3 changed files with 46 additions and 15 deletions
@@ -63,11 +63,11 @@ public class ExtractorJS extends ContentExtractor {
private static Logger LOGGER =
Logger.getLogger(ExtractorJS.class.getName());
// finds whitespace- and quote-free strings in Javascript
// finds strings in Javascript
// (areas between paired ' or " characters, possibly backslash-quoted
// on the ends, but not in the middle)
protected static final String JAVASCRIPT_STRING_EXTRACTOR =
"(\\\\{0,8}+(?:['\"]|u002[27]))([^\\s'\"]{1,"+UURI.MAX_URL_LENGTH+"})(?:\\1)";
"(\\\\{0,8}+(?:['\"]|u002[27]))([^'\"]{0,"+UURI.MAX_URL_LENGTH+"})(?:\\1)";
// GROUPS:
// (G1) ' or " with optional leading backslashes