diff options
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/handler.php | 5 | ||||
-rw-r--r-- | inc/parser/metadata.php | 5 | ||||
-rw-r--r-- | inc/parser/parser.php | 14 | ||||
-rw-r--r-- | inc/parser/renderer.php | 2 | ||||
-rw-r--r-- | inc/parser/xhtml.php | 5 |
5 files changed, 27 insertions, 4 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php index d8e6c79ea..0a021987f 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -407,6 +407,11 @@ class Doku_Handler { return true; } + function apostrophe($match, $state, $pos) { + $this->_addCall('apostrophe',array(), $pos); + return true; + } + function doublequoteopening($match, $state, $pos) { $this->_addCall('doublequoteopening',array(), $pos); return true; diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php index 85e6eefed..846bbff23 100644 --- a/inc/parser/metadata.php +++ b/inc/parser/metadata.php @@ -255,6 +255,11 @@ class Doku_Renderer_metadata extends Doku_Renderer { if ($this->capture) $this->doc .= $lang['singlequoteclosing']; } + function apostrophe() { + global $lang; + $this->doc .= $lang['apostrophe']; + } + function doublequoteopening(){ global $lang; if ($this->capture) $this->doc .= $lang['doublequoteopening']; 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' + ); + } diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php index 1b6340445..808261ddf 100644 --- a/inc/parser/renderer.php +++ b/inc/parser/renderer.php @@ -177,6 +177,8 @@ class Doku_Renderer extends DokuWiki_Plugin { function singlequoteclosing() {} + function apostrophe() {} + function doublequoteopening() {} function doublequoteclosing() {} diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index fad6f6120..438410651 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -455,6 +455,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $this->doc .= $lang['singlequoteclosing']; } + function apostrophe() { + global $lang; + $this->doc .= $lang['singlequoteclosing']; + } + function doublequoteopening() { global $lang; $this->doc .= $lang['doublequoteopening']; |