summaryrefslogtreecommitdiff
path: root/inc/parser/parser.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/parser/parser.php')
-rw-r--r--inc/parser/parser.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 991031a30..22f836709 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -623,11 +623,9 @@ class Doku_Parser_Mode_acronym extends Doku_Parser_Mode {
}
function preConnect() {
- $sep = '';
- foreach ( $this->acronyms as $acronym ) {
- $this->pattern .= $sep.'(?<=\b)'.Doku_Lexer_Escape($acronym).'(?=\b)';
- $sep = '|';
- }
+ $bound = '[\x00-\x2f\x3a-\x3f\x5b-\x7f]';
+ $acronyms = array_map('Doku_Lexer_Escape',$this->acronyms);
+ $this->pattern = '(?<='.$bound.')(?:'.join('|',$acronyms).')(?='.$bound.')';
}
function connectTo($mode) {