codimd
codimd copied to clipboard
Support multi-row and row span table syntax
trafficstars
This PR support two new table syntax, one is multi-row syntax that use \ to merge multiple row into one row. another is row-span syntax that can merge multiple column into one colume (like html rowspan attribute)
- multi-row syntax example
| Markdown | Rendered HTML |
|--------------|---------------|
| *Italic* | *Italic* | \
| | |
| - Item 1 | - Item 1 | \
| - Item 2 | - Item 2 |
| ```python | ```python \
| .1 + .2 | .1 + .2 \
| ``` | ``` |
- row span syntax
Stage | Direct Products | ATP Yields
----: | --------------: | ---------:
Glycolysis | 2 ATP ||
^^ | 2 NADH | 3--5 ATP |
Pyruvaye oxidation | 2 NADH | 5 ATP |
Citric acid cycle | 2 ATP ||
^^ | 6 NADH | 15 ATP |
^^ | 2 FADH2 | 3 ATP |
**30--32** ATP |||
[Net ATP yields per hexose]
Nice! But found that our existing table auto format would break this syntax
it's a known issue, maybe we can add preference options to turn off table auto formatting.