From d43aac1c8c239fb7f4ca8d0cb9bf03dc1d6cd958 Mon Sep 17 00:00:00 2001 From: Gina Haeussge Date: Sat, 26 Jun 2010 15:58:14 +0200 Subject: FS#1915: strip one leading and one trailing newline from code content if available --- inc/parser/xhtml.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'inc/parser') 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 .= ''.DOKU_LF.'
'; } + if ($text{0} == "\n") { + $text = substr($text, 1); + } + if (substr($text, -1) == "\n") { + $text = substr($text, 0, -1); + } + if ( is_null($language) ) { $this->doc .= '
'.$this->_xmlEntities($text).'
'.DOKU_LF; } else { -- cgit v1.2.3