From: Hamatoma Date: Sun, 5 May 2024 15:27:54 +0000 (+0200) Subject: 0.2.6 MediaWiki X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=1ae0082484934437101555e11374b36542011244;p=gadeku.git 0.2.6 MediaWiki - MediaWiki: - verbesserte RegEx-Ausdrücke in expandStarItems() - Korrekturen in specialMacrosToHtml() --- diff --git a/CHANGELOG.md b/CHANGELOG.md index f7f8de0..705eabe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ -# V 0.2.6 Word umgebaut, verbImperfect +# V 0.2.6 MediaWiki + +## Changed +- MediaWiki: + - verbesserte RegEx-Ausdrücke in expandStarItems() + - Korrekturen in specialMacrosToHtml() + +# V 0.2.7 Word umgebaut, verbImperfect ## Changed - Module Verb und Noun entfallen, Word arbeitet mit strukturiertem Attribut options diff --git a/app/Helpers/MediaWiki.php b/app/Helpers/MediaWiki.php index e752d05..f9afb28 100644 --- a/app/Helpers/MediaWiki.php +++ b/app/Helpers/MediaWiki.php @@ -9,16 +9,18 @@ class MediaWiki extends MediaWikiBase { $rc = preg_replace( [ - '/\*(\w[^*]+\w)\*/', + '/\*(\w.*?\w)\*/', '/\*<(.+?)>\*/', - '/\*-(\w[^*]+\w)-\*/', - '/\*\+(\w[^*]+\w)\+\*/' + '/\*-(\w.*?\w)-\*/', + '/\*\+(\w.*?\w)\+\*/', + '/\*(\w)\*/' ], [ '%trans($1)%', '%field($1)%', '%del($1)%', - '%add($1)%' + '%add($1)%', + '%trans($1)%', ], $text ); @@ -38,14 +40,14 @@ class MediaWiki extends MediaWikiBase break; case 'trans': $text = $matches[2]; - $info = count($matches) > 3 ? $text : substr($matches[3], 1); + $info = count($matches) <= 3 ? $text : substr($matches[3], 1); $rc = "$text"; break; case 'mark': $rc = '' . $matches[2] . ''; break; case 'add': - $rc = '' . (count($matches) == 4 ? ($matches[2] . $matches[3]) : $matches[2]) . ''; + $rc = '' . (count($matches) >= 4 ? ($matches[2] . $matches[3]) : $matches[2]) . ''; break; case 'del': $rc = '' . (count($matches) == 4 ? ($matches[2] . $matches[3]) : $matches[2]) . ''; @@ -69,12 +71,6 @@ class MediaWiki extends MediaWikiBase $class = $size == 0 ? '' : "lkn-icon-$size"; $rc = ""; break; - case 'image': - $name = $matches[2]; - $size = count($matches) < 4 ? null : $matches[3]; - $class = $size == 0 ? '' : "lkn-icon-$size"; - $rc = ""; - break; default: $rc = $matches[0]; break; diff --git a/composer.lock b/composer.lock index 5ef73e4..297b6e5 100644 --- a/composer.lock +++ b/composer.lock @@ -1056,7 +1056,7 @@ "dist": { "type": "path", "url": "../laraknife", - "reference": "fdc1af63b7d821c111b630663be1f0bcbba93fa5" + "reference": "646e4764a06caa8ed60766fd98c8ce6882479d9c" }, "require-dev": { "phpunit/phpunit": "11.0.x-dev"