Skip to content

Instantly share code, notes, and snippets.

@yellowback
Created June 27, 2013 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yellowback/5875565 to your computer and use it in GitHub Desktop.
Save yellowback/5875565 to your computer and use it in GitHub Desktop.
diff --git a/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php b/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php
index 8c9aac1..6460d01 100644
--- a/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php
+++ b/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php
@@ -54,7 +54,9 @@ class serendipity_event_bbcode extends serendipity_event
function bbcode_callback($matches) {
$type = $matches[1];
- $input = trim($matches[2], "\r\n");
+ $input = str_replace("<br />\r\n","foobarbaz123454321",$matches[2]);
+ $input = trim($input, "\r\n");
+# $input = trim($matches[2], "\r\n");
switch ($type) {
case 'code':
@@ -90,15 +92,16 @@ class serendipity_event_bbcode extends serendipity_event
$input = ob_get_contents();
ob_end_clean();
- $input = str_replace('<br />', "\n", $input);
+# $input = str_replace('<br />', "\n", $input);
break;
default:
return false;
}
- $input = "<div class=\"bb-$type-title\">" . strtoupper($type) . ":</div>"
- . "<div class=\"bb-$type\">$input</div>";
+ $input = str_replace("foobarbaz123454321","\n",$input);
+
+ $input = "<div class=\"bb-$type\">$input</div>";
return($input);
}
@@ -262,6 +265,9 @@ class serendipity_event_bbcode extends serendipity_event
margin-right: 20px;
color: black;
direction: ltr;
+ max-width: 600px;
+ max-height: 300px;
+ overflow: auto;
}
.bb-code-title, .bb-php-title {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment