From 8e266198a9d66cbcd6289e616d0df216abcc1719 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 14 Sep 2005 16:48:10 +0200 Subject: fix for acronyms, but still buggy The last change introduced a bug where acronyms inside words where marked. This fixes it partly. However there is still a bug - the following line gets both occurences of 'spec' marked as acronym and I don't know why: This is the specification also called spec. Only the last occurence of spec should be marked but both are. If the latter is missing the first one isn't marked as well. Any help appreciated. darcs-hash:20050914144810-7ad00-9e486e207cb856524a044a1d6d3ed07dbb534864.gz --- inc/parser/parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/parser.php b/inc/parser/parser.php index 22f836709..9cc257c02 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -623,9 +623,9 @@ class Doku_Parser_Mode_acronym extends Doku_Parser_Mode { } function preConnect() { - $bound = '[\x00-\x2f\x3a-\x3f\x5b-\x7f]'; + $bound = '[\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]'; $acronyms = array_map('Doku_Lexer_Escape',$this->acronyms); - $this->pattern = '(?<='.$bound.')(?:'.join('|',$acronyms).')(?='.$bound.')'; + $this->pattern = '(?<=^|'.$bound.')(?:'.join('|',$acronyms).')(?='.$bound.')'; } function connectTo($mode) { -- cgit v1.2.3