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

Markdown tables rendered incorrectly #25

Closed
sergei-mironov opened this issue Apr 30, 2020 · 3 comments
Closed

Markdown tables rendered incorrectly #25

sergei-mironov opened this issue Apr 30, 2020 · 3 comments
Labels
discussion Discussion requiring no code changes

Comments

@sergei-mironov
Copy link

The following code

```{.python .cb.run}
print('''
|   Name    |  SST-2  |  MRPC  |
|-----------|---------|--------|
| accuracy  |  0.868  | 0.757  |
| buildtime | 781.831 | 50.946 |
''')
```

produces correct output documents of html format (<table>...</table>) but for markdown documents the result is

  Name        SST-2     MRPC
  ----------- --------- --------
  accuracy    0.868     0.757
  buildtime   781.831   50.946

i.e. 1) Strange double-space at the start of every line and 2) no | characters mark table borders. As a result, Github doesn't parse such text as tables. Please, consider checking!

I run codebraid with teh following command:

codebraid pandoc \
  -f markdown -t markdown --no-cache --overwrite --standalone \
  --self-contained -o out.md inp.md.in
@sergei-mironov
Copy link
Author

I think this could be a pandoc-related problem. I'm using pandoc-2.7

@sergei-mironov
Copy link
Author

Ok, this turned out to be a pandoc thing.
The solution is to add -t gfm to the list of pandoc arguments.

@gpoore
Copy link
Owner

gpoore commented Apr 30, 2020

-t gfm is what you want in this case. Recent versions of Pandoc have apparently introduced an incompatibility in markdown-to-markdown conversion, though, so I will create a new, separate issue for that.

@gpoore gpoore added the discussion Discussion requiring no code changes label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion requiring no code changes
Projects
None yet
Development

No branches or pull requests

2 participants