summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorGina Haeussge <gina@foosel.net>2010-06-26 15:58:14 +0200
committerGina Haeussge <gina@foosel.net>2010-06-26 15:58:14 +0200
commitd43aac1c8c239fb7f4ca8d0cb9bf03dc1d6cd958 (patch)
treeb22e8b5d771f570911d39558db70e9ec6f962eea /inc/parser
parent9fa341d04ad03c9f8328d3c4a836f8191a5f2f7a (diff)
downloadrpg-d43aac1c8c239fb7f4ca8d0cb9bf03dc1d6cd958.tar.gz
rpg-d43aac1c8c239fb7f4ca8d0cb9bf03dc1d6cd958.tar.bz2
FS#1915: strip one leading and one trailing newline from code content if available
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/xhtml.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index c8862eece..c5a8b8218 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -442,6 +442,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= '</a></dt>'.DOKU_LF.'<dd>';
}
+ if ($text{0} == "\n") {
+ $text = substr($text, 1);
+ }
+ if (substr($text, -1) == "\n") {
+ $text = substr($text, 0, -1);
+ }
+
if ( is_null($language) ) {
$this->doc .= '<pre class="'.$type.'">'.$this->_xmlEntities($text).'</pre>'.DOKU_LF;
} else {