question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some markdown syntax difference with GitBook

See original GitHub issue

GitBook(Legacy) support code syntax with following syntax

`` ` ``

HonKit does not support it.

Workaround:

<code>`</code>

Probably, this changes is caused by kramed to @honkit/markup-it https://github.com/GitbookIO/gitbook-markdown/commit/0981578985933b9e3acd24adcb7cabb7e2c7849b#diff-e8acc63b1e238f3255c900eed37254b8

Related

https://github.com/asciidwango/js-primer/pull/1200

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
azucommented, Jul 3, 2020

Proposal: Downgrade markdown parser to kramed

Current HonKit has some issues on Markdown parser that is based on markup-it@2.

We can get more compatibility with GitBook Legacy by downgrading markdown parser. This is temporary action in v3.

Probably, next major version will change it.

Background

Incompatible with GitBook Legacy plugin

Some plugin depended on kramed parser #82

Incompatible with CommonMark

GitBook v4(beta) and HonKit Markdown Parser can not parse CommonMark syntax correctly

For example,

`` ` ``

and

~~~md
 ```mermaid
 graph TD;
   A-->B;
   A-->C;
   B-->D;
   C-->D;
 ```
~~~

kramed can parse these. Maybe, It is marked based parser and it close to CommonMark behavior

Action

- const markdownParser = require("@honkit/markdown");
+ const markdownParser = require("@honkit/markdown-legacy");

It will improve GitBook(legacy) compatible and It help you to smooth migrate from GitBook.

Future of Markdown parser

In V4 #15 ?

I have two proposals.

Parser plugin https://github.com/honkit/honkit/issues/84

Currently, user can not select parser as plugin. Probably, we can do it.

So, HonKit user will select @honkit/markdown or @honkit/markdown-legacy, or own custom parser. It includes asciidoc parser.

If a user want to use gitbook-plugin-uml, the user @honkit/markdown-legacy.

Rewrite markdown parser with existing markdown parser library

We want to get more CommonMark compatible in the future. I think, It is good that we use remark or Marked. These Markdown parser is compatible with CommonMark and we can add custom sytntax like # Title {#title-id}

We can not get incentive from original Markdown parser like kramed or markup-it.

📝 Actually, kramed is a fork of old marked

kramed did want to support custom syntax like mathjax. It was the reason for creating kramed.

Why fork marked ?

marked hasn’t been evolving as much as it could be lately and due to our needs with GitBook, we need features such as robust mathjax support and want to strive closer to the rising kramdown standard. https://github.com/GitbookIO/kramed

But GitBook/HonKit has supported mathjax by mathjax plugin. In other words, We not need to extend the parser.

So, We want to get rid of full scratched markdown parser. It make maintaince cost.

📝 Custom parser that is used remark or Marked is needed for basic backward compatible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdown - GitBook Documentation
Markdown is a popular markup syntax that's widely known for its simplicity and popularity online. GitBook supports it as a keyboard-friendly way to...
Read more >
GitBook - Markdown Guide
The advantage of GitBook over a tool like Docusaurus is that GitBook takes care of building and hosting the site, and the WYSIWYG...
Read more >
GitBook Toolchain Documentation for Multi-Languages.
Markdown supports two different code block styles. One uses lines indented with either four spaces or one tab whereas the other uses lines...
Read more >
Markdown Tips & Introduction · GitBook - Zhonghua Zheng
Markdown is a lightweight markup language with plain-text-formatting syntax. Its design allows it to be converted to many output formats, but the original...
Read more >
Markdown | GitBook Documentation
GitBook uses the Markdown syntax by default. This is intended as a quick reference and showcase. For more complete info, see John Gruber's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found