proper partial match detection and display in showRegExpTester
closes #180
This commit is contained in:
parent
58b1c5be81
commit
3c5d20f862
|
@ -1816,7 +1816,8 @@ function showRegExpTester(event, section = getSectionForChild(this)) {
|
||||||
const rxData = Object.assign({text}, cachedRegexps.get(text));
|
const rxData = Object.assign({text}, cachedRegexps.get(text));
|
||||||
if (!rxData.urls) {
|
if (!rxData.urls) {
|
||||||
cachedRegexps.set(text, Object.assign(rxData, {
|
cachedRegexps.set(text, Object.assign(rxData, {
|
||||||
rx: tryRegExp(text),
|
// imitate buggy Stylish-for-chrome, see detectSloppyRegexps()
|
||||||
|
rx: tryRegExp('^' + text + '$'),
|
||||||
urls: new Map(),
|
urls: new Map(),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -1882,6 +1883,7 @@ function showRegExpTester(event, section = getSectionForChild(this)) {
|
||||||
} else {
|
} else {
|
||||||
partial.push($element({appendChild: [
|
partial.push($element({appendChild: [
|
||||||
icon,
|
icon,
|
||||||
|
url.substr(0, match.index),
|
||||||
$element({tag: 'mark', textContent: match}),
|
$element({tag: 'mark', textContent: match}),
|
||||||
url.substr(match.length),
|
url.substr(match.length),
|
||||||
]}));
|
]}));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user