MyST parser does not have proper syntax for line-block and emulates line-block by creating paragraph with hardbreaks (indicated by \ followed by linebreak). This introduces incompatibility in some (perhaps uncommon, but valid) cases. One of them is table with line-block:
# Test text block inside list-table
## list-table
```{list-table}
* - A1
- B1 \
in \
3 lines
* - A2
- B2
The first table will be rendered incorrectly (as the B1 cell is a `paragraph` node with newlines inserted as raw latex `\\` which has a different meaning inside table; whereas RST will process `line_block` node inside table with `line`s correctly).
![image](https://github.com/executablebooks/MyST-Parser/assets/1029876/1b524396-6531-4c6f-823a-e00b96d3922f)
![image](https://github.com/executablebooks/MyST-Parser/assets/1029876/eaadcf05-96ce-4d62-9907-008be50dc908)
The pseudoXML is here:
Test text block inside list-table
list-table
A1
B1
\\
in
\\
3 lines
A2
B2
list-table via eval-rst
A1
B1
in
3 lines
A2
B2
```
### Expected Behavior
(proposed behavior:) paragraph with hardbreaks and no softbreaks would be converted to `line_block`. Paragraph mixing hardbreaks and softbreaks would trigger warning. Paragraphs with softbreak only are just paragraphs.
Or alternatively, document another way of creating `line_block` in MyST (I did not find one).
### To Reproduce
Compile the above source (saved as `index.md`) with this minimal `conf.py`:
```py
project="test"
extensions=['myst_parser']
```
What version of
myst-parser
are you using?2.0.0
What version dependencies are you using?
docutils==0.20.1 sphinx==7.2.6
What operating system are you using?
Linux
Describe the Bug
MyST parser does not have proper syntax for line-block and emulates line-block by creating paragraph with hardbreaks (indicated by
\
followed by linebreak). This introduces incompatibility in some (perhaps uncommon, but valid) cases. One of them is table with line-block:list-table via eval-rst
I believe #900 closes this 😄 see updated https://myst-parser.readthedocs.io/en/latest/syntax/typography.html#line-breaks
Oh, quite a co-incidence in time :) Can one use the new
line-block
directive inside alist-table
item? I am not sure.Related: #877 (paragraph with raw breaks does not work with a custom builder)
If by coincidence, you mean I saw this issue and then fixed it 😄
yes you can 👍
I'll close this as fixed, but feel free to re-open or open a new issue, if there is anything else