From df9add7216a927956b8c4f6fd9174d0103f3aed2 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 27 Jun 2005 22:18:07 +0200 Subject: Corrects to parser for , and list items This patch moves handling of and tags to the front end of the parser allowing correct processing of the replacement tag if html or php processing is disabled. It also adds listcontent_open and listcontent_close to the array of blocks not permitted within paragraps and removes html & php from the same array. darcs-hash:20050627201807-50fdc-5236124fd13a1ecc6b26f0a0b52a434ab01cee41.gz --- inc/parser/handler.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'inc') diff --git a/inc/parser/handler.php b/inc/parser/handler.php index cc90a0eb2..9865ab526 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -224,15 +224,25 @@ class Doku_Handler { } function php($match, $state, $pos) { + global $conf; if ( $state == DOKU_LEXER_UNMATCHED ) { - $this->_addCall('php',array($match), $pos); + if ($conf['phpok']) { + $this->_addCall('php',array($match), $pos); + } else { + $this->_addCall('file',array($match), $pos); + } } return TRUE; } function html($match, $state, $pos) { + global $conf; if ( $state == DOKU_LEXER_UNMATCHED ) { - $this->_addCall('html',array($match), $pos); + if($conf['htmlok']){ + $this->_addCall('html',array($match), $pos); + } else { + $this->_addCall('file',array($match), $pos); + } } return TRUE; } @@ -1198,20 +1208,20 @@ class Doku_Handler_Block { // Blocks these should not be inside paragraphs var $blockOpen = array( 'header', - 'listu_open','listo_open','listitem_open', + 'listu_open','listo_open','listitem_open','listcontent_open', 'table_open','tablerow_open','tablecell_open','tableheader_open', 'quote_open', 'section_open', // Needed to prevent p_open between header and section_open - 'code','file','php','html','hr','preformatted', + 'code','file','hr','preformatted', ); var $blockClose = array( 'header', - 'listu_close','listo_close','listitem_close', + 'listu_close','listo_close','listitem_close','listcontent_close', 'table_close','tablerow_close','tablecell_close','tableheader_close', 'quote_close', 'section_close', // Needed to prevent p_close after section_close - 'code','file','php','html','hr','preformatted', + 'code','file','hr','preformatted', ); // Stacks can contain paragraphs -- cgit v1.2.3