diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-07-14 23:45:40 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-07-14 23:45:40 +0300 |
commit | ab10524cd763ab9e7796608d40682fdb70912fd0 (patch) | |
tree | b216ed5330a5a1c79018ad3deb073f5cfac05bb1 /launcher/Markdown.cpp | |
parent | 1ccfba13ebe11a1d6ea2897db45b47c2452931f5 (diff) | |
parent | 37fb52aada16fa8533ecee3932e10fcbee0ca1d5 (diff) | |
download | PrismLauncher-ab10524cd763ab9e7796608d40682fdb70912fd0.tar.gz PrismLauncher-ab10524cd763ab9e7796608d40682fdb70912fd0.tar.bz2 PrismLauncher-ab10524cd763ab9e7796608d40682fdb70912fd0.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into export
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 |