mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 20:27:58 +01:00
fixed display of <> in help
This commit is contained in:
@@ -198,7 +198,7 @@ var g_commands = [/*{{{*/
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
["javascript", "js"],
|
["javascript", "js"],
|
||||||
["javascript {cmd}", "javascript << {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); }
|
||||||
|
|||||||
@@ -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, "<");
|
// keep <br/>
|
||||||
usage = usage.replace(/[^b][^r][^\/]>/g, ">");
|
//usage = usage.replace(/<([^b][^r].*>)/g, "<$1");
|
||||||
|
//usage = usage.replace(/[^b][^r][^\/]>/g, ">");
|
||||||
|
usage = usage.replace(/</g, "<");
|
||||||
|
usage = usage.replace(/>/g, ">");
|
||||||
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user