summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2010-12-07 16:09:01 +0100
committerAndreas Gohr <gohr@cosmocode.de>2010-12-07 16:13:50 +0100
commit9fa736b0317d46fdfb2025895fa0288fd736ca08 (patch)
tree44c52b86639b8b6d2028b4282cfdf83105ddcdaa /inc/parser
parent6a7df0a2b9ffacc9644700f5a6be74750225b8d3 (diff)
downloadrpg-9fa736b0317d46fdfb2025895fa0288fd736ca08.tar.gz
rpg-9fa736b0317d46fdfb2025895fa0288fd736ca08.tar.bz2
Make baseonly work in allowedModes
This makes it possible to have modes that do accept headers (baseonly) in the parser. Related test cases are still running through but I'm not 100% sure I did not break something here. So it should be tested a bit more. This patch will allow plugins to wrap multiple sections, however it also makes it possible to easily break XHTML validity, because headers also open and close sections, so plugin authors need to be aware! In case you wonder: this patch is not about allowing formatting inside headers.
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/parser.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 2e6b7791a..b93760f3a 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -90,7 +90,6 @@ class Doku_Parser {
if ( $mode == 'base' ) {
continue;
}
-
$this->modes[$mode]->preConnect();
foreach ( array_keys($this->modes) as $cm ) {
@@ -218,11 +217,11 @@ class Doku_Parser_Mode_footnote extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_header extends Doku_Parser_Mode {
- function preConnect() {
+ function connectTo($mode) {
//we're not picky about the closing ones, two are enough
$this->Lexer->addSpecialPattern(
'[ \t]*={2,}[^\n]+={2,}[ \t]*(?=\n)',
- 'base',
+ $mode,
'header'
);
}