fix: changelogs with too much space between lines

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-07-01 09:42:15 -03:00
parent 001bbef9ee
commit 2b65ee433f
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -363,7 +363,13 @@ void ModUpdateDialog::appendMod(CheckUpdateTask::UpdatableMod const& info)
case ModPlatform::Provider::MODRINTH: {
HoeDown h;
// HoeDown bug?: \n aren't converted to <br>
changelog_area->setHtml(h.process(info.changelog.toUtf8()).replace('\n', "<br>"));
auto text = h.process(info.changelog.toUtf8());
// Don't convert if there's an HTML tag right after (Qt rendering weirdness)
text.remove(QRegularExpression("(\n+)(?=<)"));
text.replace('\n', "<br>");
changelog_area->setHtml(text);
break;
}
case ModPlatform::Provider::FLAME: {