diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2013-11-19 21:26:50 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2013-11-19 21:26:50 +0100 |
commit | 703aeaef1a43b07dc5497dba72c98151466396cc (patch) | |
tree | 1e18a6b3fc3c28156c2e56f8a3d515b8dd6a9cf9 /inc/parser/parser.php | |
parent | 33c3b3817b00aa9384760813643fac0e33daaaff (diff) | |
parent | 14b3007921f7b66fc9e3621b861a3c83e7e9093c (diff) | |
download | rpg-703aeaef1a43b07dc5497dba72c98151466396cc.tar.gz rpg-703aeaef1a43b07dc5497dba72c98151466396cc.tar.bz2 |
Merge remote-tracking branch 'origin/master' into diff_navigation
Diffstat (limited to 'inc/parser/parser.php')
-rw-r--r-- | inc/parser/parser.php | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/inc/parser/parser.php b/inc/parser/parser.php index 915899f53..e39a4daf5 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -45,9 +45,9 @@ $PARSER_MODES = array( //------------------------------------------------------------------- /** -* Sets up the Lexer with modes and points it to the Handler -* For an intro to the Lexer see: wiki:parser -*/ + * Sets up the Lexer with modes and points it to the Handler + * For an intro to the Lexer see: wiki:parser + */ class Doku_Parser { var $Handler; @@ -70,9 +70,9 @@ class Doku_Parser { } /** - * PHP preserves order of associative elements - * Mode sequence is important - */ + * PHP preserves order of associative elements + * Mode sequence is important + */ function addMode($name, & $Mode) { if ( !isset($this->modes['base']) ) { $this->addBaseMode(new Doku_Parser_Mode_base()); @@ -134,7 +134,7 @@ class Doku_Parser { * all modes are registered * * @author Harry Fuecks <hfuecks@gmail.com> -*/ + */ class Doku_Parser_Mode { /** @@ -454,8 +454,8 @@ class Doku_Parser_Mode_table extends Doku_Parser_Mode { } function connectTo($mode) { - $this->Lexer->addEntryPattern('\n\^',$mode,'table'); - $this->Lexer->addEntryPattern('\n\|',$mode,'table'); + $this->Lexer->addEntryPattern('\s*\n\^',$mode,'table'); + $this->Lexer->addEntryPattern('\s*\n\|',$mode,'table'); } function postConnect() { @@ -555,7 +555,7 @@ class Doku_Parser_Mode_preformatted extends Doku_Parser_Mode { class Doku_Parser_Mode_code extends Doku_Parser_Mode { function connectTo($mode) { - $this->Lexer->addEntryPattern('<code(?=.*</code>)',$mode,'code'); + $this->Lexer->addEntryPattern('<code\b(?=.*</code>)',$mode,'code'); } function postConnect() { @@ -571,7 +571,7 @@ class Doku_Parser_Mode_code extends Doku_Parser_Mode { class Doku_Parser_Mode_file extends Doku_Parser_Mode { function connectTo($mode) { - $this->Lexer->addEntryPattern('<file(?=.*</file>)',$mode,'file'); + $this->Lexer->addEntryPattern('<file\b(?=.*</file>)',$mode,'file'); } function postConnect() { @@ -621,7 +621,7 @@ class Doku_Parser_Mode_acronym extends Doku_Parser_Mode { var $pattern = ''; function Doku_Parser_Mode_acronym($acronyms) { - usort($acronyms,array($this,'_compare')); + usort($acronyms,array($this,'_compare')); $this->acronyms = $acronyms; } @@ -652,12 +652,12 @@ class Doku_Parser_Mode_acronym extends Doku_Parser_Mode { $a_len = strlen($a); $b_len = strlen($b); if ($a_len > $b_len) { - return -1; + return -1; } else if ($a_len < $b_len) { - return 1; + return 1; } - return 0; + return 0; } } @@ -807,7 +807,6 @@ class Doku_Parser_Mode_quotes extends Doku_Parser_Mode { "\"",$mode,'doublequoteclosing' ); - } function getSort() { |