summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/parser/xhtml.php4
-rw-r--r--inc/parserutils.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index d9e3e784e..7777490a1 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -358,11 +358,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
function preformatted($text) {
- $this->doc .= '<pre class="code">' . trim($this->_xmlEntities($text)) . '</pre>'. DOKU_LF;
+ $this->doc .= '<pre class="code">' . trim($this->_xmlEntities($text),"\n\r") . '</pre>'. DOKU_LF;
}
function file($text) {
- $this->doc .= '<pre class="file">' . trim($this->_xmlEntities($text)). '</pre>'. DOKU_LF;
+ $this->doc .= '<pre class="file">' . trim($this->_xmlEntities($text),"\n\r"). '</pre>'. DOKU_LF;
}
function quote_open() {
diff --git a/inc/parserutils.php b/inc/parserutils.php
index e1f9922f0..6dadbd0c6 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -657,7 +657,7 @@ function p_xhtml_cached_geshi($code, $language, $wrapper='pre') {
// remove GeSHi's wrapper element (we'll replace it with our own later)
// we need to use a GeSHi wrapper to avoid <BR> throughout the highlighted text
- $highlighted_code = preg_replace('!^<pre[^>]*>|</pre>$!','',$geshi->parse_code());
+ $highlighted_code = trim(preg_replace('!^<pre[^>]*>|</pre>$!','',$geshi->parse_code()),"\n\r");
io_saveFile($cache,$highlighted_code);
}