From: Tim Düsterhus Date: Mon, 30 May 2022 10:09:00 +0000 (+0200) Subject: Flarum: Strip `>` in front of code blocks X-Git-Tag: 5.5.0_RC_1~2^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0346416ae81dbbd3532af8cc7d46ac25f9591b73;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.exporter.git Flarum: Strip `>` in front of code blocks This avoids a rendering issue with Parsedown, which would strip the indentation in the code block, possibly breaking YAML et al. --- diff --git a/files/lib/system/exporter/Flarum1xExporter.class.php b/files/lib/system/exporter/Flarum1xExporter.class.php index 13f8d82..c309d23 100644 --- a/files/lib/system/exporter/Flarum1xExporter.class.php +++ b/files/lib/system/exporter/Flarum1xExporter.class.php @@ -710,6 +710,8 @@ final class Flarum1xExporter extends AbstractExporter // Unparser::unparse() $message = \html_entity_decode(\strip_tags($message), ENT_QUOTES, 'UTF-8'); + $message = \preg_replace('/(^|\n)> (```)/', '\\1\\2', $message); + $out = $parsedown->text($message); $out = \preg_replace(