mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 19:47:59 +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",
|
||||
function ()
|
||||
{
|
||||
function quote(str) commands.quoteArg['"'](str)
|
||||
|
||||
let title = "";
|
||||
let keyword = "";
|
||||
let tags = "";
|
||||
@@ -286,7 +288,7 @@ function Bookmarks() //{{{
|
||||
{
|
||||
let bmark = bmarks[0];
|
||||
|
||||
title = " -title=\"" + bmark.title + "\"";
|
||||
title = " -title=" + quote(bmark.title);
|
||||
if (bmark.keyword)
|
||||
keyword = " -keyword=\"" + bmark.keyword + "\"";
|
||||
if (bmark.tags.length > 0)
|
||||
@@ -295,7 +297,7 @@ function Bookmarks() //{{{
|
||||
else
|
||||
{
|
||||
if (buffer.title != buffer.URL)
|
||||
title = " -title=\"" + buffer.title + "\"";
|
||||
title = " -title=" + quote(buffer.title);
|
||||
}
|
||||
|
||||
commandline.open(":", "bmark " + buffer.URL + title + keyword + tags, modes.EX);
|
||||
|
||||
@@ -907,11 +907,11 @@ function Commands() //{{{
|
||||
return [count, cmd, !!special, args || ""];
|
||||
},
|
||||
|
||||
/** @property @private */
|
||||
get complQuote() complQuote, // XXX: needed?
|
||||
/** @property */
|
||||
get complQuote() complQuote,
|
||||
|
||||
/** @property @private */
|
||||
get quoteArg() quoteArg, // XXX: needed?
|
||||
/** @property */
|
||||
get quoteArg() quoteArg, // XXX: better somewhere else?
|
||||
|
||||
/**
|
||||
* Remove the user-defined command with matching <b>name</b>.
|
||||
|
||||
Reference in New Issue
Block a user