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

Div surrounding grid table does not produce correct output #6481

Closed
jack-kirton opened this issue Jun 23, 2020 · 3 comments
Closed

Div surrounding grid table does not produce correct output #6481

jack-kirton opened this issue Jun 23, 2020 · 3 comments

Comments

@jack-kirton
Copy link

Pandoc version: 2.9.2.1

Having a div surround a table that pandoc will write as a grid table in markdown creates invalid pandoc markdown, as reading that markdown back into pandoc causes the table to not be recognised as a table.

table-test.txt is a grid table in hand-written markdown.

Running the command pandoc --from=markdown+smart --to=native < table-test.txt | pandoc --from=native --to=markdown+smart produces a grid table surrounded by native markdown div markers, ::: {.div-class} and :::.

Examining the AST by running pandoc --from=markdown+smart --to=native shows that the table was not interpreted as a table but as plain text.

@mb21
Copy link
Collaborator

mb21 commented Jun 23, 2020

so the output of pandoc table-test.txt -t markdown (which is basically what you're doing) is:

::: {.div-class}
+-------+-----+-----+-------------------------------------------------+
| Col 1 | Col | Col | Col 4                                           |
|       | 2   | 3   |                                                 |
+:=====:+:===:+:===:+:================================================+
| High  | Med | Med | Some description of something.                  |
|       | ium | ium |                                                 |
|       |     |     | Another paragraph to ensure Pandoc produces a   |
|       |     |     | grid table.                                     |
+-------+-----+-----+-------------------------------------------------+
:::

and you would prefer html divs instead of markdown divs, or...?

@jack-kirton
Copy link
Author

Sorry for the roundabout series of commands, you are exactly right that is what is produced.
The problem arises when that table is fed back into pandoc as it is no longer recognised as a table, just a paragraph in a div.

@mb21
Copy link
Collaborator

mb21 commented Jun 23, 2020

ah yes, of course. there are newlines missing...

@jgm jgm closed this as completed in ee782cc Jun 23, 2020
jgm added a commit that referenced this issue Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants