Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support rendering Table elements #19

Open
gen2thomas opened this issue Jan 11, 2024 · 3 comments
Open

Support rendering Table elements #19

gen2thomas opened this issue Jan 11, 2024 · 3 comments

Comments

@gen2thomas
Copy link

First, thanks for this small and nice renderer and the description in the README and provided examples!

After parsing a document with table extension, like this:

gm := goldmark.New(goldmark.WithExtensions(extension.Table))

...the resulting document is a "little bit destroyed", this seems to be caused by the missing "KindTable" for the renderer.

Is there a plan to implement it or would this be possible by a custom extension, e.g. with this PR #16 ?

@gen2thomas
Copy link
Author

maybe this would help with the implementation:
https://github.com/Kunde21/markdownfmt/blob/master/markdown/renderer_table.go

@teekennedy
Copy link
Owner

Hi @gen2thomas thanks for the suggestions and glad you found the repo to be nice!

I'll look into adding the missing test coverage for #16 as well as adding support for the table extension directly. I was planning on adding support for all extensions in GitHub Flavored Markdown but got sidetracked with other projects.

@teekennedy
Copy link
Owner

#16 has been merged. One step closer!

guineveresaenger added a commit to pulumi/pulumi-terraform-bridge that referenced this issue Nov 8, 2024
The markdown renderer we use does [not support rendering out
tables](teekennedy/goldmark-markdown#19). This
pull request adds a table renderer, since the raw HTML rendering is
lossy and does not handle inline code blocks well.

With this change, a table will properly render out inline code blocks
inside table cells, and correctly handle tables as separate elements.

Example from NewRelic's `docs/_index.md` page with this change applied:

<img width="898" alt="Screenshot 2024-11-07 at 5 07 42 PM"
src="https://github.com/user-attachments/assets/01392204-814e-4469-ac94-c0c03832a9c6">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants