1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 20:44:11 +01:00

Hackier but more reliable literal() stuff.

This commit is contained in:
Kris Maglione
2014-06-18 12:24:55 -07:00
parent fdf188166d
commit cde8cd6763
15 changed files with 66 additions and 63 deletions

View File

@@ -252,11 +252,11 @@ var Template = Module("Template", {
return [tag, { xmlns: "dactyl" }, topic];
},
linkifyHelp: function linkifyHelp(str, help) {
let re = util.regexp(literal(/*
let re = util.regexp(literal(function () /*
(?P<pre> [/\s]|^)
(?P<tag> '[\w-]+' | :(?:[\w-]+!?|!) | (?:._)?<[\w-]+>\w* | \b[a-zA-Z]_(?:[\w[\]]+|.) | \[[\w-;]+\] | E\d{3} )
(?= [[\)!,:;./\s]|$)
*/), "gx");
*/$), "gx");
return this.highlightSubstrings(str, (function () {
for (let res in re.iterate(str))
yield [res.index + res.pre.length, res.tag.length];