From e950d12fe605bb70cca7a030eab49f5e29719f0b Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Thu, 13 Mar 2014 17:55:21 +0000 Subject: improvements to double quote matching --- inc/parser/handler.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'inc/parser') 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; } -- cgit v1.2.3