Markdown-Edit icon indicating copy to clipboard operation
Markdown-Edit copied to clipboard

Use GitHub's fork of `cmark`

Open RoyiAvital opened this issue 8 years ago • 6 comments

Hello,

I saw that GutHub released their fork of cmark. It seems to be the fastest engine out there.

Some writing about it: http://ropensci.org/blog/blog/2016/12/02/commonmark

Any chance using it on MarkDownEdit?

Thank You.

RoyiAvital avatar Dec 03 '16 09:12 RoyiAvital

Another vote for this. I'm forced to disable github in the settings because of some really weird rendering bug that still doesn't make any sense to me. However, that means I can't use tables instead as the price paid for turning off github rendering. Which means I am forced to not use this app until that gets fixed.

Switching to this fork of cmark would fix that issue.

nonplayer avatar Dec 17 '16 20:12 nonplayer

Pandoc does differ from GitHub in several ways. Sure would be nice if they published C# bindings for their fork. I'll add it to the to-do list.

mike-ward avatar Dec 18 '16 15:12 mike-ward

I'm guessing it would. Kind of annoyed they don't have a binary release. Still needs C# bindings. Thinking I might do that.

mike-ward avatar Jan 03 '17 13:01 mike-ward

According to python bindings you only need to import cmark_markdown_to_html function

veremenko-y avatar Jan 13 '17 19:01 veremenko-y

Oh if that were only true. The extensions (like tables, strikethrough) have to be loaded separately. See the cmark.cs file and look at main.c

My current thinking is to just run the cmark.exe program with the correct arguments and stream the result. Much like what is done with Pandoc elsewhere.

mike-ward avatar Jan 13 '17 20:01 mike-ward

Yes, I tried to add it as well as adding it to "CustomMarkdownConverter", tables didn't work. Building is not difficult though. You just need cmake.

UPD

Actually this seems to be working. No checkboxes tough. But tables and strikes work.

  "CustomMarkdownConverter": "d:\\Documents\\Sources\\cmark\\build\\src\\cmark.exe",
  "CustomMarkdownConverterArgs": "-e table -e strikethrough -e autolink -e tagfilter",

UPD2

Looked through cmark code, seems checkboxes are not part of the cmark.

UPD3

The only downside of this solution is the headers like # are not rendering in the first line. Otherwise it works fine.

veremenko-y avatar Jan 13 '17 21:01 veremenko-y