generated from jCloud/repository-template
Pipe character in Markdown tables causes the cell to be split into multiple cells #70
Notifications
Total Time Spent: 33 minutes
jakob.scheid
33 minutes
No due date set.
Dependencies
No dependencies set.
Reference: jCloud/jcloud-docsgen#70
Reference in new issue
Block a user
Pipe character in values of Markdown table cells
Problem
When a Markdown table cell contains a
|(for example, when a Python parameter type hint contains|), it is simply copied. Therefore, the cell is split into two cells since|is the separator for Markdown table cells (in most Markdown renderers which support tables). To prevent this behavior, the character should be replaced by an escape sequence (\|).This is a real problem as
|is often used in type hints and type hints are put into Markdown tables.How to reproduce this issue
Generate the documentation for following Python code with Markdown tables enabled:
The output will contain following:
Markdown renderers which support tables will render the cells
param, `int, float`, normal, --, --Actual behavior
The character
|in a Markdown table cell value causes the cell to be split into multiple cells.Excepted behavior
Even if a cell value contains a
|, it remains a single cell and is not split into multiple cells.Goal
The
|character in the values of Markdown table cells is always escaped to ensure that a cell remains a single cell.'|' character in Markdown tables is not escapedto '|' character in Markdown tables causes the cell to be split into multiple cells'|' character in Markdown tables causes the cell to be split into multiple cellsto Pipe character in Markdown tables causes the cell to be split into multiple cells