diff options
author | redmatrix <git@macgirvin.com> | 2016-05-30 19:49:15 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-30 19:49:15 -0700 |
commit | 9e9f2e13fec2c86d9dc40042edb0e33b99afc6c1 (patch) | |
tree | b2934f4a90fe16f0374f65b8f3e61b396fb0ba8b | |
parent | 6602ff83dd54d0e17c985a5f527654fc2ed83eea (diff) | |
parent | 0757dbf07f4c8d137f388c529301229b0d1fd8ef (diff) | |
download | volse-hubzilla-9e9f2e13fec2c86d9dc40042edb0e33b99afc6c1.tar.gz volse-hubzilla-9e9f2e13fec2c86d9dc40042edb0e33b99afc6c1.tar.bz2 volse-hubzilla-9e9f2e13fec2c86d9dc40042edb0e33b99afc6c1.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
-rw-r--r-- | include/bbcode.php | 14 | ||||
-rw-r--r-- | view/css/conversation.css | 20 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 5 |
3 files changed, 21 insertions, 18 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index f47dc6f2e..42741b392 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -477,9 +477,12 @@ function bb_observer($Text) { return $Text; } - - - +function bb_code($match) { + if(strpos($match[0], "<br />")) + return '<code>' . trim($match[1]) . '</code>'; + else + return '<code class="inline-code">' . trim($match[1]) . '</code>'; +} @@ -785,12 +788,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) $Text = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/sm", "<span style=\"font-family: $1;\">$2</span>", $Text); } - // Declare the format for [code] layout - $CodeLayout = '<code>$1</code>'; - // Check for [code] text if (strpos($Text,'[code]') !== false) { - $Text = preg_replace("/\[code\](.*?)\[\/code\]/ism", "$CodeLayout", $Text); + $Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/ism", 'bb_code', $Text); } // Check for [spoiler] text diff --git a/view/css/conversation.css b/view/css/conversation.css index 9b99efba4..328f9df02 100644 --- a/view/css/conversation.css +++ b/view/css/conversation.css @@ -1,11 +1,3 @@ -/* common */ - -code { - font-family: Courier, monospace; - display: block; - overflow: auto; -} - /* jot */ .jothidden input { @@ -305,6 +297,18 @@ a.wall-item-name-link { /* bb-code */ +code { + font-family: Courier, monospace; + font-size: 1em; + padding: 1em 1.5em; + display: block; +} + +code.inline-code { + padding: 0px 4px; + display: inline; +} + .overline { text-decoration: overline; } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 1c2e8cdb2..ae2826516 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -113,13 +113,12 @@ pre code { } code { - font-size: 1em; - padding: 1em 1.5em; - border: 1px solid #ccc; background: #ccc; color: #000; } + + pre { background: #F5F5F5; color: #333; |