summaryrefslogtreecommitdiff
path: root/inc/parser/parser.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-10-28 20:22:05 +0100
committerAndreas Gohr <andi@splitbrain.org>2013-10-28 20:22:05 +0100
commit23a363f01514464eb2238ac09ec7723d03d57ecb (patch)
tree42c7dcff8c5b0e506a25d08ee5583ed2a24e8602 /inc/parser/parser.php
parent25e48e54df60b3df6efa365daceb3a8966c8f427 (diff)
parent75cf672f10a71f7dee6d50eb70b742689838bc36 (diff)
downloadrpg-23a363f01514464eb2238ac09ec7723d03d57ecb.tar.gz
rpg-23a363f01514464eb2238ac09ec7723d03d57ecb.tar.bz2
Merge branch 'master' into stable
* master: (413 commits) release preparation fixed strict violation in ACL plugin Fix issues from teams:i18n:translation-check in localizations ensure locale is set back to the original value skip FS#2867 test if \s doesn't match \xA0 after attempting to change the locale unittests for auth_loadACL translation update allow charset for SSO to be configured FS#2148 Mailer: avoid overlong headers in content ids FS#2868 translation update translation update replace \s, \S with [ \t], [^ \t] in regexs used with acls translation update translation update translation update translation update Fix handling of the legacy subscription action name remove obsolete opera handling and session closing remove no longer used ajax.php fix proxy CONNECT where HTTP 1.1 answer is given ...
Diffstat (limited to 'inc/parser/parser.php')
-rw-r--r--inc/parser/parser.php31
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() {