Skip to content

Commit

Permalink
Merge pull request #618 from lioneie/master
Browse files Browse the repository at this point in the history
Fix #619, Chinese preview in HTML is complete now. Update README.md.
  • Loading branch information
wereturtle authored Jun 27, 2021
2 parents d1a510b + 2ede460 commit e7ddef1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <your_ghostwriter_folder_location>
$ qmake
$ qmake-qt5
$ make
# make install

Expand Down
4 changes: 2 additions & 2 deletions src/cmarkgfmapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit e7ddef1

Please sign in to comment.