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

escape literal & with the HTML entity in :set help string

This commit is contained in:
Doug Kearns
2007-08-21 13:52:39 +00:00
parent c46e912114
commit 655db213ba
2 changed files with 2 additions and 1 deletions

View File

@@ -1060,7 +1060,7 @@ function Commands() //{{{
"<code class=\"command\">:set option?</code> or <code class=\"command\">:set option</code>(for string and list options) shows the current value of an option.<br/>" + "<code class=\"command\">:set option?</code> or <code class=\"command\">:set option</code>(for string and list options) shows the current value of an option.<br/>" +
"<code class=\"command\">:set option&amp;</code> resets an option to its default value.<br/>" + "<code class=\"command\">:set option&amp;</code> resets an option to its default value.<br/>" +
"<code class=\"command\">:set option+={value}</code> and <code class=\"command\">:set option-={value}</code> will add/subtract {value} to a number option and append/remove {value} to a string option.<br/>" + "<code class=\"command\">:set option+={value}</code> and <code class=\"command\">:set option-={value}</code> will add/subtract {value} to a number option and append/remove {value} to a string option.<br/>" +
"<code class=\"command\">:set all</code> will show the current value of all options and <code class=\"command\">:set all&</code> will reset all options to their default values.<br/>", "<code class=\"command\">:set all</code> will show the current value of all options and <code class=\"command\">:set all&amp;</code> will reset all options to their default values.<br/>",
completer: function(filter) { return vimperator.completion.get_options_completions(filter); } completer: function(filter) { return vimperator.completion.get_options_completions(filter); }
} }
)); ));

View File

@@ -61,6 +61,7 @@ vimperator.help = function(section, easter) //{{{
//usage = usage.replace(/[^b][^r][^\/]>/g, "&gt;"); //usage = usage.replace(/[^b][^r][^\/]>/g, "&gt;");
usage = usage.replace(/</g, "&lt;"); usage = usage.replace(/</g, "&lt;");
usage = usage.replace(/>/g, "&gt;"); usage = usage.replace(/>/g, "&gt;");
usage = usage.replace(/&/g, "&amp;");
usage = usage.replace(/\\n/g, "<br/>"); usage = usage.replace(/\\n/g, "<br/>");
// color [count], [!], {arg} and [arg] in the usage, not nice and error prone but the regexp work (for now) // color [count], [!], {arg} and [arg] in the usage, not nice and error prone but the regexp work (for now)
usage = usage.replace(/({[^}]+})/g, "<span class=\"argument\">$1</span>"); // required args usage = usage.replace(/({[^}]+})/g, "<span class=\"argument\">$1</span>"); // required args