1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 18:27:57 +01:00

fixed display of <> in help

This commit is contained in:
Martin Stubenschrott
2007-04-29 02:18:18 +00:00
parent 3a72a70bcb
commit 8822a151a5
2 changed files with 10 additions and 6 deletions

View File

@@ -198,7 +198,7 @@ var g_commands = [/*{{{*/
], ],
[ [
["javascript", "js"], ["javascript", "js"],
["javascript {cmd}", "javascript &lt;&lt; {endpattern}<br/>{script}<br/>{endpattern}"], ["javascript {cmd}", "javascript <<{endpattern}\\n{script}\\n{endpattern}"], // \\n is changed to <br> in the help.js code
"Run any javascript command through eval()", "Run any javascript command through eval()",
"Acts as a javascript interpreter by passing the argument to <code>eval()</code>.<br/>" + "Acts as a javascript interpreter by passing the argument to <code>eval()</code>.<br/>" +
"<code>:javascript alert('Hello world')</code> would show a dialog box with the text \"Hello world\".<br/>" + "<code>:javascript alert('Hello world')</code> would show a dialog box with the text \"Hello world\".<br/>" +
@@ -654,14 +654,14 @@ var g_mappings = [/*{{{*/
[ [
["ZQ"], ["ZQ"],
["ZQ"], ["ZQ"],
"Quit Vimperator, no matter how many tabs/windows are open. The session is not stored.", "Quit and don't save the session",
"Works like <code class=command>:qall</code>.", "Works like <code class=command>:qall</code>.",
function(count) { quit(false); } function(count) { quit(false); }
], ],
[ [
["ZZ"], ["ZZ"],
["ZZ"], ["ZZ"],
"Save the session and quit", "Quit and save the session",
"Quit Vimperator, no matter how many tabs/windows are open. The session is stored.<br/>" + "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.<br/>" +
"Works like <code class=command>:xall</code>.", "Works like <code class=command>:xall</code>.",
function(count) { quit(true); } function(count) { quit(true); }
@@ -699,7 +699,7 @@ var g_mappings = [/*{{{*/
[ [
["h", "<Left>"], ["h", "<Left>"],
["{count}h", "{count}<Left>"], ["{count}h", "{count}<Left>"],
"Scroll document to the left" + "Scroll document to the left",
"Count is supported: <code class=mapping>10h</code> will move 10 times as much to the left.", "Count is supported: <code class=mapping>10h</code> will move 10 times as much to the left.",
"If the document cannot scroll more, a beep is emmited (unless <code class=setting>'beep'</code> is turned off).", "If the document cannot scroll more, a beep is emmited (unless <code class=setting>'beep'</code> is turned off).",
function(count) { scrollBufferRelative(-1, 0); } function(count) { scrollBufferRelative(-1, 0); }

View File

@@ -86,8 +86,12 @@ function help(section, easter)
{ {
var usage = commands[i][USAGE][j]; var usage = commands[i][USAGE][j];
usage = usage.replace(/<(?!br\/>)/g, "&lt;"); // keep <br/>
usage = usage.replace(/[^b][^r][^\/]>/g, "&gt;"); //usage = usage.replace(/<([^b][^r].*>)/g, "&lt;$1");
//usage = usage.replace(/[^b][^r][^\/]>/g, "&gt;");
usage = usage.replace(/</g, "&lt;");
usage = usage.replace(/>/g, "&gt;");
usage = usage.replace(/\\n/g, "<br/>");
// color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now) // color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now)
usage = usage.replace(/(^|;|\n|\s|\]|\}|=|<br\/?>)({.*?}|\[.*?\])/gm, "$1<span class=argument>$2</span>"); usage = usage.replace(/(^|;|\n|\s|\]|\}|=|<br\/?>)({.*?}|\[.*?\])/gm, "$1<span class=argument>$2</span>");
// and the 'setting' in a different color // and the 'setting' in a different color