mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 08:47:58 +01:00
Fix #335 (Escape quotes in page title when adding bookmarks with 'a' command).
This commit is contained in:
@@ -276,6 +276,8 @@ function Bookmarks() //{{{
|
|||||||
"Open a prompt to bookmark the current URL",
|
"Open a prompt to bookmark the current URL",
|
||||||
function ()
|
function ()
|
||||||
{
|
{
|
||||||
|
function quote(str) commands.quoteArg['"'](str)
|
||||||
|
|
||||||
let title = "";
|
let title = "";
|
||||||
let keyword = "";
|
let keyword = "";
|
||||||
let tags = "";
|
let tags = "";
|
||||||
@@ -286,7 +288,7 @@ function Bookmarks() //{{{
|
|||||||
{
|
{
|
||||||
let bmark = bmarks[0];
|
let bmark = bmarks[0];
|
||||||
|
|
||||||
title = " -title=\"" + bmark.title + "\"";
|
title = " -title=" + quote(bmark.title);
|
||||||
if (bmark.keyword)
|
if (bmark.keyword)
|
||||||
keyword = " -keyword=\"" + bmark.keyword + "\"";
|
keyword = " -keyword=\"" + bmark.keyword + "\"";
|
||||||
if (bmark.tags.length > 0)
|
if (bmark.tags.length > 0)
|
||||||
@@ -295,7 +297,7 @@ function Bookmarks() //{{{
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (buffer.title != buffer.URL)
|
if (buffer.title != buffer.URL)
|
||||||
title = " -title=\"" + buffer.title + "\"";
|
title = " -title=" + quote(buffer.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
commandline.open(":", "bmark " + buffer.URL + title + keyword + tags, modes.EX);
|
commandline.open(":", "bmark " + buffer.URL + title + keyword + tags, modes.EX);
|
||||||
|
|||||||
@@ -907,11 +907,11 @@ function Commands() //{{{
|
|||||||
return [count, cmd, !!special, args || ""];
|
return [count, cmd, !!special, args || ""];
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @property @private */
|
/** @property */
|
||||||
get complQuote() complQuote, // XXX: needed?
|
get complQuote() complQuote,
|
||||||
|
|
||||||
/** @property @private */
|
/** @property */
|
||||||
get quoteArg() quoteArg, // XXX: needed?
|
get quoteArg() quoteArg, // XXX: better somewhere else?
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the user-defined command with matching <b>name</b>.
|
* Remove the user-defined command with matching <b>name</b>.
|
||||||
|
|||||||
Reference in New Issue
Block a user