diff options
author | andi <andi@splitbrain.org> | 2005-06-26 13:15:13 +0200 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-06-26 13:15:13 +0200 |
commit | af146da051337e3c5821b6e482d5121816294c67 (patch) | |
tree | 3bb6f7545dccc50585aad9f62c1c91bddb102486 /inc/parser/handler.php | |
parent | cc634a6d3f826b31b955a7ef29b8611384146158 (diff) | |
download | rpg-af146da051337e3c5821b6e482d5121816294c67.tar.gz rpg-af146da051337e3c5821b6e482d5121816294c67.tar.bz2 |
paragraphtypes for syntax plugins
darcs-hash:20050626111513-9977f-5b317b14c9544a0c0a637d21816542d394e6606f.gz
Diffstat (limited to 'inc/parser/handler.php')
-rw-r--r-- | inc/parser/handler.php | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php index d2d201282..6b0d99cf4 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -1195,7 +1195,7 @@ class Doku_Handler_Block { var $atStart = TRUE; var $skipEolKey = -1; - // Blocks don't contain linefeeds + // Blocks these should not be inside paragraphs var $blockOpen = array( 'header', 'listu_open','listo_open','listitem_open', @@ -1214,7 +1214,7 @@ class Doku_Handler_Block { 'code','file','php','html','hr','preformatted', ); - // Stacks can contain linefeeds + // Stacks can contain paragraphs var $stackOpen = array( 'footnote_open','section_open', ); @@ -1222,7 +1222,34 @@ class Doku_Handler_Block { var $stackClose = array( 'footnote_close','section_close', ); - + + + /** + * Constructor. Adds loaded syntax plugins to the block and stack + * arrays + * + * @author Andreas Gohr <andi@splitbrain.org> + */ + function Doku_Handler_Block(){ + global $DOKU_PLUGINS; + //check if syntax plugins were loaded + if(!is_array($DOKU_PLUGINS['syntax'])) return; + foreach($DOKU_PLUGINS['syntax'] as $n => $p){ + $ptype = $p->getPType(); + if($ptype == 'block'){ + $this->blockOpen[] = 'plugin_'.$n; + $this->blockOpen[] = 'plugin_'.$n.'_open'; + $this->blockClose[] = 'plugin_'.$n; + $this->blockClose[] = 'plugin_'.$n.'_close'; + }elseif($ptype == 'stack'){ + $this->stackOpen[] = 'plugin_'.$n; + $this->stackOpen[] = 'plugin_'.$n.'_open'; + $this->stackClose[] = 'plugin_'.$n; + $this->stackClose[] = 'plugin_'.$n.'_close'; + } + } + } + /** * Close a paragraph if needed * |