Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
gedoor committed Jan 1, 2019
1 parent 48010f4 commit 60899b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/src/main/assets/updateLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
**2019/01/01**
* 祝大家元旦快乐
* 修复不显示再按一次退出程序的BUG
* 支持不写规则用js直接处理网页内容

**2018/12/30**
* 目录和书签可以滑动切换
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public AnalyzeCollection getElements(String rule) {
if (!StringUtils.isTrimEmpty(source.rule)) {
switch (source.mode) {
case JSon:
collection = new AnalyzeCollection(getAnalyzeByJSonPath().readList(source.rule), _isJSON);
collection = new AnalyzeCollection(getAnalyzeByJSonPath().readList(source.rule), true);
break;
case XPath:
collection = new AnalyzeCollection(getAnalyzeByXPath().getElements(source.rule));
Expand All @@ -171,8 +171,6 @@ class SourceRule {
String js;

SourceRule(String ruleStr) {
if (_isJSON && !StringUtils.startWithIgnoreCase(ruleStr, "@JSON:"))
throw new AssertionError("Content analyze");
String str[] = ruleStr.split("@js:");
if (StringUtils.startWithIgnoreCase(str[0], "@XPath:")) {
mode = Mode.XPath;
Expand All @@ -181,7 +179,11 @@ class SourceRule {
mode = Mode.JSon;
rule = str[0].substring(6);
} else {
mode = Mode.Default;
if (_isJSON) {
mode = Mode.JSon;
} else {
mode = Mode.Default;
}
rule = str[0];
}
if (str.length > 1) {
Expand Down

0 comments on commit 60899b2

Please sign in to comment.