summaryrefslogtreecommitdiff
path: root/inc/parser/parser.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2007-06-26 20:17:35 +0200
committerAndreas Gohr <andi@splitbrain.org>2007-06-26 20:17:35 +0200
commit5fc8a92587e0735b0e14cf636361b9e66a74709d (patch)
tree477059614714ad9fd192113aa30c925ccb85f044 /inc/parser/parser.php
parent6e52162e9002646db30fd1efee3ee8025729b878 (diff)
downloadrpg-5fc8a92587e0735b0e14cf636361b9e66a74709d.tar.gz
rpg-5fc8a92587e0735b0e14cf636361b9e66a74709d.tar.bz2
some more tweaks to the smart quote parser
Now all test cases succeed, but there is probably still trouble with certain conditions. darcs-hash:20070626181735-7ad00-dd6e51e37cda7ca63077a2779afe1753ad975f84.gz
Diffstat (limited to 'inc/parser/parser.php')
-rw-r--r--inc/parser/parser.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 747c60333..709f063da 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -757,26 +757,26 @@ class Doku_Parser_Mode_quotes extends Doku_Parser_Mode {
function connectTo($mode) {
global $conf;
- $ws = '[\s/\#~:+=&%@\-;,\x28\x29\]\[{}><"\']'; // whitespace
- $nws = '[^\s/\#~:+=&%@\-;,\x28\x29\]\[{}><"\']'; // non whitespace
+ $ws = '\s/\#~:+=&%@\-\x28\x29\]\[{}><"\''; // whitespace
+ $punc = ';,\.?!';
if($conf['typography'] == 2){
$this->Lexer->addSpecialPattern(
- "(?<=^|$ws)'(?=$nws)",$mode,'singlequoteopening'
+ "(?<=^|[$ws])'(?=[^$ws$punc])",$mode,'singlequoteopening'
);
$this->Lexer->addSpecialPattern(
- "(?<=^|$nws)'(?=$|$ws)",$mode,'singlequoteclosing'
+ "(?<=^|[^$ws]|[$punc])'(?=$|[$ws$punc])",$mode,'singlequoteclosing'
);
$this->Lexer->addSpecialPattern(
- "(?<=^|$nws)'(?=$|$nws)",$mode,'apostrophe'
+ "(?<=^|[^$ws$punc])'(?=$|[^$ws$punc])",$mode,'apostrophe'
);
}
$this->Lexer->addSpecialPattern(
- "(?<=^|$ws)\"(?=$nws)",$mode,'doublequoteopening'
+ "(?<=^|[$ws])\"(?=[^$ws$punc])",$mode,'doublequoteopening'
);
$this->Lexer->addSpecialPattern(
- "(?<=^|$nws)\"",$mode,'doublequoteclosing'
+ "\"",$mode,'doublequoteclosing'
);