r-lib / commonmark

High Performance CommonMark and Github Markdown Rendering in R
https://docs.ropensci.org/commonmark/
Other
88 stars 11 forks source link

Alignment of table cells when converting to XML #9

Closed maelle closed 5 years ago

maelle commented 5 years ago

Asking because of my tinkr package.

maelle commented 5 years ago

When I convert Markdown to XML, the alignment information is lost.

To keep it, I could convert to html instead, but this creates at least one problem: code blocks are transformed to something harder to parse, information seems lost <pre><code class="language-{r">knitr.

So for now my package will lose alignment of tables.

@jeroen do you think there could be a way for commonmark::markdown_xml to keep the alignment of cells as an arbitrary attribute?

jeroen commented 5 years ago

I think this is fixed in the dev version

jeroen commented 5 years ago

No wait it looks like that attribute is not stored in the xml. Hmmm 🤔

jeroen commented 5 years ago

I think you should open an issue at the Github cmark repo: https://github.com/github/cmark. It looks like they forgot to encode the alignment attribute in the xml.

jeroen commented 5 years ago

This was fixed in commonmark 1.6