From c30347e161c33e2eff05db5e77b72895643e4b9b Mon Sep 17 00:00:00 2001 From: lioneie Date: Sun, 6 Jun 2021 22:39:31 +0800 Subject: [PATCH 1/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 039b036b6..3bdbf472f 100644 --- a/README.md +++ b/README.md @@ -79,14 +79,14 @@ For Debian or Ubuntu distributions: For Fedora: - $ sudo dnf install qt-devel qt5-qtbase-devel qt5-qtsvg-devel qt5-qtmultimedia-devel qt5-qtwebengine-devel hunspell-devel + $ sudo dnf install qt-devel qt5-qtbase-devel qt5-qtsvg-devel qt5-qtmultimedia-devel qt5-qtwebengine-devel hunspell-devel qt5-linguist For other Linux flavors, the list will be similar; `qmake` will tell you if you are missing anything. Next, open a terminal window, and enter the following commands: $ cd - $ qmake + $ qmake-qt5 $ make # make install From 2ede4601eb8d1f7892d4037714d5bd410d4100c0 Mon Sep 17 00:00:00 2001 From: lioneie Date: Mon, 7 Jun 2021 01:00:41 +0800 Subject: [PATCH 2/2] Fix #619. Chinese preview in HTML is complete now. --- src/cmarkgfmapi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmarkgfmapi.cpp b/src/cmarkgfmapi.cpp index 3fe023843..b33b124cd 100644 --- a/src/cmarkgfmapi.cpp +++ b/src/cmarkgfmapi.cpp @@ -93,7 +93,7 @@ MarkdownAST *CmarkGfmAPI::parse(const QString &text, const bool smartTypographyE // the nodes returned in the AST are shifted or missing when // UTF-8 characters longer than 1 byte are encountered. // - cmark_parser_feed(parser, text.toLatin1().data(), text.length()); + cmark_parser_feed(parser, text.toLatin1().data(), text.toLocal8Bit().length()); cmark_node *root = cmark_parser_finish(parser); MarkdownAST *ast = new MarkdownAST(root); @@ -127,7 +127,7 @@ QString CmarkGfmAPI::renderToHtml(const QString &text, const bool smartTypograph cmark_parser_attach_syntax_extension(parser, d->tagfilterExt); cmark_parser_attach_syntax_extension(parser, d->tasklistExt); - cmark_parser_feed(parser, text.toUtf8().data(), text.length()); + cmark_parser_feed(parser, text.toUtf8().data(), text.toLocal8Bit().length()); cmark_node *root = cmark_parser_finish(parser); char *output = cmark_render_html(root, opts, cmark_parser_get_syntax_extensions(parser));