1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 19:34:11 +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);