From c127a5c35566f108780b4bc4c69f955e3be13193 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 3 Jun 2009 23:00:43 +0000 Subject: [PATCH] - web: make [pre] work similar to [code]. fixes #798 Note: I had to move [pre] to the top of the preg list to make this work. Not sure why. svn path=/trunk/boinc/; revision=18285 --- checkin_notes | 11 +++++++++++ html/inc/text_transform.inc | 4 ++-- html/user/main.css | 7 +++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index ee53be4a9a..1493444fd6 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5018,3 +5018,14 @@ David 3 June 2009 client/ cs_statefile.cpp + +David 3 June 2009 + - web: make [pre] work similar to [code]. fixes #798 + Note: I had to move [pre] to the top of the + preg list to make this work. Not sure why. + + html/ + inc/ + text_transform.inc + user/ + main.css diff --git a/html/inc/text_transform.inc b/html/inc/text_transform.inc index 96abd7ba70..f914e6dded 100644 --- a/html/inc/text_transform.inc +++ b/html/inc/text_transform.inc @@ -108,6 +108,7 @@ function bb2html($text) { $httpsregex = "(?:\"?)https\:\/\/([^\[\"<\ ]+)(?:\"?)"; // List of allowable tags $bbtags = array ( + "@\[pre\](.*?)\[/pre\]@eis", "@\[code\](.*?)\[/code\]@eis", "@\[b\](.*?)\[/b\]@is", "@\[i\](.*?)\[/i\]@is", @@ -122,7 +123,6 @@ function bb2html($text) { "@\[quote\](.*?)\[/quote\]@is", "@\[list\](.*?)\[/list\]@is", "@\[list=1\](.*?)\[/list\]@is", - "@\[pre\](.*?)\[/pre\]@eis", "@\[img\]$urlregex\[/img\]@is", "@\[color=(?:\"?)(.{3,8})(?:\"?)\](.*?)\[/color\]@is", "@((?:
    |
|))@is", @@ -139,6 +139,7 @@ function bb2html($text) { // What the above tags are turned in to $htmltags = array ( + "'
'.stop_recursion('\\1').'
'", "'
'.stop_recursion('\\1').'
'", "\\1", "\\1", @@ -153,7 +154,6 @@ function bb2html($text) { "
\\1
", "

", "

    \\1

", - "'

'.remove_br('\\1').'
'", "", "\\2", "\\1
  • \\2\n\\3", diff --git a/html/user/main.css b/html/user/main.css index 52c9614f2b..175e6317cd 100644 --- a/html/user/main.css +++ b/html/user/main.css @@ -373,6 +373,13 @@ span.inboxunread { white-space: nowrap; } +div.pre { + font-family: "Courier New", courier, monospace; + display: block; + white-space: nowrap; + overflow: auto; +} + .code { font-family: "Courier New", courier, monospace; display: block;