From 60ffb9f53a115cba3a81ef133cee78aef80b1bc9 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Thu, 13 May 2004 20:48:34 +0000 Subject: [PATCH] fixed '''Caesar''''s bug where 4 ticks where not properly handled. --- includes/Parser.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/includes/Parser.php b/includes/Parser.php index 2f9b9cca37..e65acb3683 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -675,6 +675,21 @@ class Parser return $s; } + /* private */ function handle4Quotes( &$state, $token ) + { + /* This one makes some assumptions. + * '''Caesar''''s army => Caesar's army + * ''''Caesar'''' was a roman emperor => 'Caesar' was a roman emperor + * These assumptions might be wrong, but any other assumption might be wrong, too. + * So here we go */ + if ( $state["strong"] !== false ) { + return $this->handle3Quotes( $state, $token ) . "'"; + } else { + return "'" . $this->handle3Quotes( $state, $token ); + } + } + + /* private */ function handle3Quotes( &$state, $token ) { if ( $state["strong"] !== false ) { @@ -830,7 +845,7 @@ class Parser $txt = "\n
\n"; break; case "'''": - # This and the three next ones handle quotes + # This and the four next ones handle quotes $txt = $this->handle3Quotes( $state, $token ); break; case "''": @@ -839,6 +854,9 @@ class Parser case "'''''": $txt = $this->handle5Quotes( $state, $token ); break; + case "''''": + $txt = $this->handle4Quotes( $state, $token ); + break; case "": # empty token $txt=""; -- 2.20.1