mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-27 02:55:46 +01:00
Don't push pass through mode multiple times. Closes issue #641.
This commit is contained in:
@@ -74,11 +74,11 @@ update(Sheet.prototype, {
|
||||
return preamble + css;
|
||||
|
||||
let selectors = filter.map(function (part)
|
||||
!/^(?:[a-z-]+[:*]|[a-z-.]+$)/i.test(part) ? "regexp(" + (".*(?:" + part + ").*").quote() + ")" :
|
||||
!/^(?:[a-z-]+[:*]|[a-z-.]+$)/i.test(part) ? "regexp(" + Styles.quote(".*(?:" + part + ").*") + ")" :
|
||||
(/[*]$/.test(part) ? "url-prefix" :
|
||||
/[\/:]/.test(part) ? "url"
|
||||
: "domain")
|
||||
+ '("' + part.replace(/"/g, "%22").replace(/\*$/, "") + '")')
|
||||
+ '(' + Styles.quote(part.replace(/\*$/, "")) + ')')
|
||||
.join(",\n ");
|
||||
|
||||
return preamble + "@-moz-document " + selectors + " {\n\n" + css + "\n\n}\n";
|
||||
@@ -530,7 +530,17 @@ var Styles = Module("Styles", {
|
||||
| [^;}\s]+
|
||||
)
|
||||
]]>, "gix", this)
|
||||
})
|
||||
}),
|
||||
|
||||
/**
|
||||
* Quotes a string for use in CSS stylesheets.
|
||||
*
|
||||
* @param {string} str
|
||||
* @returns {string}
|
||||
*/
|
||||
quote: function quote(str) {
|
||||
return '"' + str.replace(/([\\"])/g, "\\$1").replace(/\n/g, "\\00000a") + '"';
|
||||
},
|
||||
}, {
|
||||
commands: function (dactyl, modules, window) {
|
||||
const { commands, contexts, styles } = modules;
|
||||
|
||||
Reference in New Issue
Block a user