diff options
author | Andreas Gohr <andi@splitbrain.org> | 2007-05-13 10:40:24 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2007-05-13 10:40:24 +0200 |
commit | 57d757d195f73c836bb15fc1cd1d01fa0dcc75b1 (patch) | |
tree | 352ac377c2f568e7e9e1229d81733a95011d753c /inc/parser/parser.php | |
parent | d613051ae9b5db0528293dbe6d918df6dbd7dc4e (diff) | |
download | rpg-57d757d195f73c836bb15fc1cd1d01fa0dcc75b1.tar.gz rpg-57d757d195f73c836bb15fc1cd1d01fa0dcc75b1.tar.bz2 |
distinction between apostrophes and single quotes FS#1127
This patch adds another parser mode for apostrophes. Now single quote closing
markers are handled different from apostrophes for better local typograpy
support.
Needs testing and languages updates.
darcs-hash:20070513084024-7ad00-d20fe093a093c265d357b178e199c1596b484996.gz
Diffstat (limited to 'inc/parser/parser.php')
-rw-r--r-- | inc/parser/parser.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/inc/parser/parser.php b/inc/parser/parser.php index 0d88580d2..577e1137c 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -758,19 +758,25 @@ class Doku_Parser_Mode_multiplyentity extends Doku_Parser_Mode { class Doku_Parser_Mode_quotes extends Doku_Parser_Mode { function connectTo($mode) { + $ws = '[\s/\#~:\.?+=&%@!\-;,\x28\x29\]\[{}><"\']'; // whitespace + $nws = '[^\s/\#~:\.?+=&%@!\-;,\x28\x29\]\[{}><"\']'; // non whitespace $this->Lexer->addSpecialPattern( - '(?<=^|\s)\'(?=\S)',$mode,'singlequoteopening' + "(?<=^|$ws)'(?=$nws)",$mode,'singlequoteopening' ); $this->Lexer->addSpecialPattern( - '(?<=^|\S)\'',$mode,'singlequoteclosing' + "(?<=^|$nws)'(?=$|$ws)",$mode,'singlequoteclosing' ); $this->Lexer->addSpecialPattern( - '(?<=^|\s)"(?=\S)',$mode,'doublequoteopening' + "(?<=^|$nws)'(?=$|$nws)",$mode,'apostrophe' ); $this->Lexer->addSpecialPattern( - '(?<=^|\S)"',$mode,'doublequoteclosing' + "(?<=^|$ws)\"(?=$nws)",$mode,'doublequoteopening' ); + $this->Lexer->addSpecialPattern( + "(?<=^|$nws)\"",$mode,'doublequoteclosing' + ); + } |