Skip to content

Commit

Permalink
Fix: custom rules is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
eight04 committed Jun 17, 2019
1 parent e8bf6ba commit c3e7051
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/linkify-plus-plus.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,11 @@ function createOptions(pref) {
if (changes.includeElement != null || changes.excludeElement != null) {
options.validator = createValidator(options);
}
options.matcher = new linkifyPlusPlusCore.UrlMatcher(options);
options.onlink = options.embedImageExcludeElement ? onlink : null;
if (typeof options.customRules === "string") {
options.customRules = stringToList(options.customRules);
}
options.matcher = new linkifyPlusPlusCore.UrlMatcher(options);
options.onlink = options.embedImageExcludeElement ? onlink : null;
}

function onlink({link, range, content}) {
Expand Down
4 changes: 2 additions & 2 deletions extension/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -2031,11 +2031,11 @@ function createOptions(_local_pref) {
if (changes.includeElement != null || changes.excludeElement != null) {
options.validator = createValidator(options);
}
options.matcher = new UrlMatcher(options);
options.onlink = options.embedImageExcludeElement ? onlink : null;
if (typeof options.customRules === "string") {
options.customRules = stringToList(options.customRules);
}
options.matcher = new UrlMatcher(options);
options.onlink = options.embedImageExcludeElement ? onlink : null;
}

function onlink({link, range, content}) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ function createOptions(pref) {
if (changes.includeElement != null || changes.excludeElement != null) {
options.validator = createValidator(options);
}
options.matcher = new UrlMatcher(options);
options.onlink = options.embedImageExcludeElement ? onlink : null;
if (typeof options.customRules === "string") {
options.customRules = stringToList(options.customRules);
}
options.matcher = new UrlMatcher(options);
options.onlink = options.embedImageExcludeElement ? onlink : null;
}

function onlink({link, range, content}) {
Expand Down

0 comments on commit c3e7051

Please sign in to comment.