1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 11:18:00 +01:00

Fix something to do with <a>.

This commit is contained in:
Kris Maglione
2009-08-19 14:02:56 -04:00
parent 820b509eb3
commit 9d77c018ca
15 changed files with 12 additions and 13 deletions

7
common/content/commands.js Executable file → Normal file
View File

@@ -506,13 +506,14 @@ function Commands() //{{{
commandToString: function (args)
{
let res = [args.command + (args.bang ? "!" : "")];
function quote(str) quoteArg[/\s/.test(str) ? '"' : ""](str);
function quote(str) quoteArg[/[\s"'\\]|^$/.test(str) ? '"' : ""](str);
for (let [opt, val] in Iterator(args.options || {}))
{
res.push(opt);
let char = /^-.$/.test(opt) ? " " : "=";
if (val != null)
res.push(quote(val));
opt += char + quote(val)
res.push(opt);
}
for (let [,arg] in Iterator(args.arguments || []))
res.push(quote(arg));