Skip to content

Commit

Permalink
Make baseonly work in allowedModes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
splitbrain committed Dec 7, 2010
1 parent 6a7df0a commit 9fa736b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions inc/parser/parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ function connectModes() {
if ( $mode == 'base' ) {
continue;
}

$this->modes[$mode]->preConnect();

foreach ( array_keys($this->modes) as $cm ) {
Expand Down Expand Up @@ -218,11 +217,11 @@ function getSort() {
//-------------------------------------------------------------------
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'
);
}
Expand Down

0 comments on commit 9fa736b

Please sign in to comment.