From 0f47c9ff76faf9c123bdedb1532c4f62216966f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 17 Jun 2022 09:50:25 +0200 Subject: [PATCH] Flarum: Force any line breaks to be hard line breaks Apparently Flarum's Markdown flavor interprets all line breaks within the entered text content as hard breaks, instead of soft wrapping of the source. --- files/lib/system/exporter/Flarum1xExporter.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/lib/system/exporter/Flarum1xExporter.class.php b/files/lib/system/exporter/Flarum1xExporter.class.php index 014076a..23861df 100644 --- a/files/lib/system/exporter/Flarum1xExporter.class.php +++ b/files/lib/system/exporter/Flarum1xExporter.class.php @@ -727,6 +727,9 @@ final class Flarum1xExporter extends AbstractExporter '[/center]' => '[/align]', ]); + + $message = \preg_replace("/\r?\n/", ' \\0', $message); + $out = $parsedown->text($message); $out = \preg_replace( -- 2.20.1