From 852896dac73e74fd791a001b8ea6bf23aa9e7791 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 30 Jul 2006 22:14:42 +0200 Subject: strip trailing line in higlighted code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current code add 2 unwanted trailing lines in highlighted code. One is produced by DokuWiki's syntax and is fixed by this patch. The second one is created somewhere inside GeShi. A bug report was submitted upatream [1] [1] http://sourceforge.net/tracker/index.php?funcŪtail&aid31373&group_id4997&atidg0231 darcs-hash:20060730201442-7ad00-222a23a3bfccd7c53105e7175cdc9992be2d8076.gz --- inc/parser/xhtml.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/parser') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 3c71bb54e..e8fb84494 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -387,8 +387,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer { if ( is_null($language) ) { $this->preformatted($text); } else { - //strip leading blank line + //strip leading and trailing blank line $text = preg_replace('/^\s*?\n/','',$text); + $text = preg_replace('/\s*?\n$/','',$text); $this->doc .= p_xhtml_cached_geshi($text, $language); } } -- cgit v1.2.3