From 93a34bf33e9f8f0649d38e94d18cbba2a11fd651 Mon Sep 17 00:00:00 2001 From: Chris Smith <chris.eureka@jalakai.co.uk> Date: Thu, 13 Mar 2008 21:39:50 +0100 Subject: [PATCH] update preformatted syntax mode to ignore entire blocks of white space This patch only updates the actual "preformatted" syntax mode, that is only preformatted blocks caused by leading blanks on a line. If the entire block is empty, it is ignored. ie. if a block of preformatted text has leading or trailing empty lines and some non-empty lines, the leading and trailing content are preserved. darcs-hash:20080313203950-f07c6-9d0745b157e45b61b06ff0c7d85bec8558946c1e.gz --- inc/parser/handler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 9f158e4a8..b36fd142b 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -1047,7 +1047,9 @@ class Doku_Handler_Preformatted { $this->text .= $call[1][0]; break; case 'preformatted_end': - $this->CallWriter->writeCall(array('preformatted',array($this->text),$this->pos)); + if (trim($this->text)) { + $this->CallWriter->writeCall(array('preformatted',array($this->text),$this->pos)); + } break; } } -- GitLab