aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2018-02-19 11:11:31 +0100
committerGitHub <noreply@github.com>2018-02-19 11:11:31 +0100
commitfac5d81790262c0583d42f442018157066c3bf3f (patch)
treef877f4b3a336f691d0665f5f2e2857cb33cef4f8 /include
parentb56633e1d6d36de4a65ef07f9ee64a9e98a79c2b (diff)
parentc444e40c016c0faaec604335093b19661b3585b7 (diff)
downloadvolse-hubzilla-fac5d81790262c0583d42f442018157066c3bf3f.tar.gz
volse-hubzilla-fac5d81790262c0583d42f442018157066c3bf3f.tar.bz2
volse-hubzilla-fac5d81790262c0583d42f442018157066c3bf3f.zip
Merge pull request #981 from anaqreon/dev
Update code tag styling so bbcode [code] blocks and wiki markdown ...
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 0c85a0a4e..86fd24696 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -628,7 +628,7 @@ function bb_code_unprotect_sub($match) {
function bb_code($match) {
if(strpos($match[0], "<br />"))
- return '<code>' . bb_code_protect(trim($match[1])) . '</code>';
+ return '<pre><code>' . bb_code_protect(trim($match[1])) . '</code></pre>';
else
return '<code class="inline-code">' . bb_code_protect(trim($match[1])) . '</code>';
}
@@ -636,15 +636,21 @@ function bb_code($match) {
function bb_code_options($match) {
if(strpos($match[0], "<br />")) {
$class = "";
+ $pre = true;
} else {
$class = "inline-code";
+ $pre = false;
}
if(strpos($match[1], 'nowrap')) {
$style = "overflow-x: auto; white-space: pre;";
} else {
$style = "";
}
- return '<code class="'. $class .'" style="'. $style .'">' . bb_code_protect(trim($match[2])) . '</code>';
+ if($pre) {
+ return '<pre><code class="'. $class .'" style="'. $style .'">' . bb_code_protect(trim($match[2])) . '</code></pre>';
+ } else {
+ return '<code class="'. $class .'" style="'. $style .'">' . bb_code_protect(trim($match[2])) . '</code>';
+ }
}
function bb_highlight($match) {