Merge pull request #713 from redstrate/fix-html-rendering

This commit is contained in:
flow 2023-01-07 12:57:35 -03:00 committed by Sefa Eyeoglu
parent 699fce4482
commit 4438684ce6
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951

View File

@ -428,6 +428,10 @@ void ModPage::updateUi()
text += "<hr>";
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();
}