1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-31 11:02:37 +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

@@ -61,6 +61,7 @@ vimperator.help = function(section, easter) //{{{
//usage = usage.replace(/[^b][^r][^\/]>/g, ">");
usage = usage.replace(/</g, "&lt;");
usage = usage.replace(/>/g, "&gt;");
usage = usage.replace(/&/g, "&amp;");
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)
usage = usage.replace(/({[^}]+})/g, "<span class=\"argument\">$1</span>"); // required args