summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorchris <chris@teacherscpd.co.uk>2005-06-27 22:18:07 +0200
committerchris <chris@teacherscpd.co.uk>2005-06-27 22:18:07 +0200
commitdf9add7216a927956b8c4f6fd9174d0103f3aed2 (patch)
treeae6d36485a96094d61d60fad58589861188418e8 /inc/parser
parentc753235098227b8f2a72c68d2c8faddb202fab04 (diff)
downloadrpg-df9add7216a927956b8c4f6fd9174d0103f3aed2.tar.gz
rpg-df9add7216a927956b8c4f6fd9174d0103f3aed2.tar.bz2
Corrects to parser for <html>, <php> and list items
This patch moves handling of <html> and <php> tags to the front end of the parser allowing correct processing of the replacement <file> 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
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/handler.php22
1 files changed, 16 insertions, 6 deletions
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