From 58b56c06b2faa9a63bc301bd437972956880e6fa Mon Sep 17 00:00:00 2001 From: andi Date: Fri, 22 Apr 2005 13:13:30 +0200 Subject: fixed paragraph control darcs-hash:20050422111330-9977f-49c1d37044084e1b0fd3d379f77df55d1c1557eb.gz --- inc/parser/handler.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'inc/parser') diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 9f8dc3076..23c830abf 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -1156,6 +1156,7 @@ class Doku_Handler_Block { var $inParagraph = FALSE; var $atStart = TRUE; + var $skipEolKey = -1; // Blocks don't contain linefeeds var $blockOpen = array( @@ -1221,12 +1222,38 @@ class Doku_Handler_Block { if ( !$this->atStart ) { if ( $call[0] == 'eol' ) { - + + + /* XXX if ( $this->inParagraph ) { $this->calls[] = array('p_close',array(), $call[2]); } $this->calls[] = array('p_open',array(), $call[2]); $this->inParagraph = TRUE; + */ + + # Check this isn't an eol instruction to skip... + if ( $this->skipEolKey != $key ) { + # Look to see if the next instruction is an EOL + if ( isset($calls[$key+1]) && $calls[$key+1][0] == 'eol' ) { + + if ( $this->inParagraph ) { + $this->calls[] = array('p_close',array(), $call[2]); + } + + $this->calls[] = array('p_open',array(), $call[2]); + $this->inParagraph = TRUE; + + + # Mark the next instruction for skipping + $this->skipEolKey = $key+1; + + }else{ + //if this is just a single eol make a space from it + $this->calls[] = array('cdata',array(" "), $call[2]); + } + } + } else { -- cgit v1.2.3