From 4438684ce6e3ffc51f21bb33f4c2d77ac206ac7f Mon Sep 17 00:00:00 2001 From: flow Date: Sat, 7 Jan 2023 12:57:35 -0300 Subject: [PATCH] Merge pull request #713 from redstrate/fix-html-rendering --- launcher/ui/pages/modplatform/ModPage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp index 677bc4d66..75be25b2d 100644 --- a/launcher/ui/pages/modplatform/ModPage.cpp +++ b/launcher/ui/pages/modplatform/ModPage.cpp @@ -428,6 +428,10 @@ void ModPage::updateUi() text += "
"; HoeDown h; + + // hoedown bug: it doesn't handle markdown surrounded by block tags (like center, div) so strip them + current.extraData.body.remove(QRegularExpression("<[^>]*(?:center|div)\\W*>")); + ui->packDescription->setHtml(text + (current.extraData.body.isEmpty() ? current.description : h.process(current.extraData.body.toUtf8()))); ui->packDescription->flush(); }