diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-07-02 12:50:45 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-07-02 12:50:45 +0300 |
commit | 6c4cf085e028a76dd6c0fb4d9649783b3d97aefd (patch) | |
tree | 859e8a0a8a5fb44fc58c1c18130bad6b9c723e46 /launcher/Markdown.cpp | |
parent | 87155e346c33288fccb68c3b9029a11b658395b2 (diff) | |
parent | b51f1f1d41a6153c37b1d61a04df8ece5004cc27 (diff) | |
download | PrismLauncher-6c4cf085e028a76dd6c0fb4d9649783b3d97aefd.tar.gz PrismLauncher-6c4cf085e028a76dd6c0fb4d9649783b3d97aefd.tar.bz2 PrismLauncher-6c4cf085e028a76dd6c0fb4d9649783b3d97aefd.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into curse
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/Markdown.cpp')
-rw-r--r-- | launcher/Markdown.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/launcher/Markdown.cpp b/launcher/Markdown.cpp new file mode 100644 index 00000000..426067bf --- /dev/null +++ b/launcher/Markdown.cpp @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-3.0-only +/* + * Prism Launcher - Minecraft Launcher + * Copyright (C) 2023 Joshua Goins <josh@redstrate.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +#include "Markdown.h" + +QString markdownToHTML(const QString& markdown) +{ + const QByteArray markdownData = markdown.toUtf8(); + char* buffer = cmark_markdown_to_html(markdownData.constData(), markdownData.length(), CMARK_OPT_NOBREAKS | CMARK_OPT_UNSAFE); + + QString htmlStr(buffer); + + free(buffer); + + return htmlStr; +}
\ No newline at end of file |