go-term-markdown icon indicating copy to clipboard operation
go-term-markdown copied to clipboard

Switch to goldmark

Open afranke opened this issue 5 years ago • 6 comments

It’s actually maintained and possibly has better results. Michael told me IRL this would be a thing to do, I’m just opening this issue to keep track of it (and let potential contributors know about it so they can claim that task).

afranke avatar Jan 23 '20 14:01 afranke

And as a bonus we get GFM support out of the box.

  • [x] Awesome

afranke avatar Jan 23 '20 15:01 afranke

This should be "relatively" easy as gomarkdown and goldmark share a very similar API. So the goal is to swap the parser/AST to use the goldmark one which would bring compliance with CommonMark and indeed GFM. From a quick look, the API is also less awkward here and there so that's also a win.

Most of the rendering code should stay very similar, with just a glue change everywhere.

A few pointers:

  • https://github.com/yuin/goldmark, the markdown HTML renderer
  • https://godoc.org/github.com/yuin/goldmark/ast, the reusable parser/AST
  • https://godoc.org/github.com/yuin/goldmark/extension/ast extension to the AST, notably tables

MichaelMure avatar Jan 23 '20 17:01 MichaelMure

This should be "relatively" easy

The one who wrote that is an idiot. It is not easy.

MichaelMure avatar Apr 19 '20 14:04 MichaelMure

Most of the switch is done in https://github.com/MichaelMure/go-term-markdown/pull/20

At least 2 outstanding part to fix: links and images

MichaelMure avatar May 11 '20 12:05 MichaelMure

Links and images are done, build is green. It's getting close!

MichaelMure avatar May 24 '20 23:05 MichaelMure

is this still being worked on?

luisdavim avatar Feb 04 '22 12:02 luisdavim