1
0
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:
Doug Kearns
2009-08-10 13:56:10 +10:00
parent c43dbf510e
commit eca673911e
2 changed files with 8 additions and 6 deletions

View File

@@ -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);

View File

@@ -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>.