diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2014-03-13 17:55:21 +0000 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2014-03-13 17:55:21 +0000 |
commit | e950d12fe605bb70cca7a030eab49f5e29719f0b (patch) | |
tree | 2808e4fbcfe87fc2444600d7b944daa1432b11d5 /inc/parser | |
parent | 069942acdaa5ba825bc3f92c7093b5071789f1ca (diff) | |
download | rpg-e950d12fe605bb70cca7a030eab49f5e29719f0b.tar.gz rpg-e950d12fe605bb70cca7a030eab49f5e29719f0b.tar.bz2 |
improvements to double quote matching
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/handler.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 8ae991209..dfaf1adaa 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -12,6 +12,7 @@ class Doku_Handler { var $status = array( 'section' => false, + 'doublequote' => 0, ); var $rewriteBlocks = true; @@ -401,11 +402,17 @@ class Doku_Handler { function doublequoteopening($match, $state, $pos) { $this->_addCall('doublequoteopening',array(), $pos); + $this->status['doublequote']++; return true; } function doublequoteclosing($match, $state, $pos) { - $this->_addCall('doublequoteclosing',array(), $pos); + if ($this->status['doublequote'] <= 0) { + $this->doublequoteopening($match, $state, $pos); + } else { + $this->_addCall('doublequoteclosing',array(), $pos); + $this->status['doublequote'] = max(0, --$this->status['doublequote']); + } return true; } |