diff options
author | flow <flowlnlnln@gmail.com> | 2023-01-13 16:16:00 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-13 16:16:00 -0300 |
commit | b937d334362c0810ab59b3bc4660a2bbea31c7da (patch) | |
tree | 6c971fe381d661884864bfb0ddb5e6ed565eb569 /launcher/ui/pages/modplatform | |
parent | f7244fbf68febd2ea7543862dbcd69635ccb579b (diff) | |
parent | ff7878217d6a5bab7cd688bb2051ef212c8b6117 (diff) | |
download | PrismLauncher-b937d334362c0810ab59b3bc4660a2bbea31c7da.tar.gz PrismLauncher-b937d334362c0810ab59b3bc4660a2bbea31c7da.tar.bz2 PrismLauncher-b937d334362c0810ab59b3bc4660a2bbea31c7da.zip |
Merge pull request #714 from redstrate/cmark
Diffstat (limited to 'launcher/ui/pages/modplatform')
-rw-r--r-- | launcher/ui/pages/modplatform/ModPage.cpp | 11 | ||||
-rw-r--r-- | launcher/ui/pages/modplatform/ftb/FtbPage.cpp | 5 | ||||
-rw-r--r-- | launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp | 6 |
3 files changed, 6 insertions, 16 deletions
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp index 75be25b2..0f30689e 100644 --- a/launcher/ui/pages/modplatform/ModPage.cpp +++ b/launcher/ui/pages/modplatform/ModPage.cpp @@ -43,13 +43,11 @@ #include <QRegularExpression> #include <memory> -#include <HoeDown.h> - #include "minecraft/MinecraftInstance.h" #include "minecraft/PackProfile.h" #include "ui/dialogs/ModDownloadDialog.h" #include "ui/widgets/ProjectItem.h" - +#include "Markdown.h" ModPage::ModPage(ModDownloadDialog* dialog, BaseInstance* instance, ModAPI* api) : QWidget(dialog) @@ -427,11 +425,6 @@ 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->setHtml(text + (current.extraData.body.isEmpty() ? current.description : markdownToHTML(current.extraData.body))); ui->packDescription->flush(); } diff --git a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp index b08f3bc4..7d59a6ae 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp +++ b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp @@ -43,7 +43,7 @@ #include "ui/dialogs/NewInstanceDialog.h" #include "modplatform/modpacksch/FTBPackInstallTask.h" -#include "HoeDown.h" +#include "Markdown.h" FtbPage::FtbPage(NewInstanceDialog* dialog, QWidget *parent) : QWidget(parent), ui(new Ui::FtbPage), dialog(dialog) @@ -175,8 +175,7 @@ void FtbPage::onSelectionChanged(QModelIndex first, QModelIndex second) selected = filterModel->data(first, Qt::UserRole).value<ModpacksCH::Modpack>(); - HoeDown hoedown; - QString output = hoedown.process(selected.description.toUtf8()); + QString output = markdownToHTML(selected.description.toUtf8()); ui->packDescription->setHtml(output); // reverse foreach, so that the newest versions are first diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp index 8ab2ad1d..0bb11d83 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp @@ -42,11 +42,10 @@ #include "BuildConfig.h" #include "InstanceImportTask.h" #include "Json.h" +#include "Markdown.h" #include "ui/widgets/ProjectItem.h" -#include <HoeDown.h> - #include <QComboBox> #include <QKeyEvent> #include <QPushButton> @@ -280,8 +279,7 @@ void ModrinthPage::updateUI() text += "<hr>"; - HoeDown h; - text += h.process(current.extra.body.toUtf8()); + text += markdownToHTML(current.extra.body.toUtf8()); ui->packDescription->setHtml(text + current.description); ui->packDescription->flush(); |