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

<tbody> is missed on rendering doc #56

Closed
blackst0ne opened this issue Oct 19, 2017 · 2 comments
Closed

<tbody> is missed on rendering doc #56

blackst0ne opened this issue Oct 19, 2017 · 2 comments

Comments

@blackst0ne
Copy link
Contributor

I have such a simple markdown with two tables:

| Input       | Expected         | Actual    |
| ----------- | ---------------- | --------- |
| One         | Two              | Three     |

| Header   | Row  | Example |
| :------: | ---: | :------ |
| Foo      | Bar  | Baz     |

I want to render it to a doc and then to a HTML string using the CommonMarker::HtmlRenderer.new.render, but the result gets lost the <tbody> tag of the second table.

require 'commonmarker'

content = File.read('path/to/markdown.md')
doc = CommonMarker.render_doc(content, :DEFAULT, [:autolink, :table, :tagfilter])
CommonMarker::HtmlRenderer.new.render(doc)

In my real case I use my custom renderer inherited from the CommonMarker::HtmlRenderer, but it doesn't matter because the bug is reproducible with the gem's methods.

By the way, if I run either doc.to_html or CommonMarker.render_html(content, :DEFAULT, [:autolink, :table, :tagfilter]), the second <tbody> is added just as expected.

commonmarker-0.17.4
ruby 2.3.5p376

@gjtorikian
Copy link
Owner

Good report, thanks! Sorry for the trouble. I've got the fix and will push it up shortly.

@blackst0ne
Copy link
Contributor Author

@gjtorikian thank you for the quick response! 👍

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