Pipe character in Markdown tables causes the cell to be split into multiple cells #70

Closed
opened 2026-10-21 10:52:52 +02:00 by jakob.scheid · 0 comments
Owner

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:

def function(param: int | float): ...

The output will contain following:

### Parameters

| Parameter | Type | Kind | Default value | Description |
| --- | --- | --- | --- | --- |
| `param` | `int | float` | normal | -- | -- |

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.

# 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: ```python def function(param: int | float): ... ``` The output will contain following: ```markdown ### Parameters | Parameter | Type | Kind | Default value | Description | | --- | --- | --- | --- | --- | | `param` | `int | float` | normal | -- | -- | ``` 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.
jakob.scheid added the Kind/Bug
Priority
High
2
labels 2026-10-21 10:52:52 +02:00
jakob.scheid added this to the Project Board project 2026-10-21 10:52:52 +02:00
jakob.scheid moved this to To Do in Project Board on 2026-10-21 10:53:45 +02:00
jakob.scheid added this to the 0.2.3 milestone 2026-10-21 10:53:49 +02:00
jakob.scheid changed title from '|' character in Markdown tables is not escaped to '|' character in Markdown tables causes the cell to be split into multiple cells 2026-10-21 10:55:04 +02:00
jakob.scheid added the
Reviewed
Confirmed
1
label 2026-10-21 11:57:58 +02:00
jakob.scheid self-assigned this 2026-10-21 11:58:18 +02:00
jakob.scheid started working 2026-10-21 11:58:21 +02:00
jakob.scheid moved this to In progress in Project Board on 2026-10-21 11:59:24 +02:00
jakob.scheid added reference fix/markdown-table-cells-pipe 2026-10-21 11:59:26 +02:00
jakob.scheid worked for 33 minutes 2026-10-21 12:32:12 +02:00
jakob.scheid moved this to Review in Project Board on 2026-10-21 12:32:16 +02:00
jakob.scheid changed title from '|' character in Markdown tables causes the cell to be split into multiple cells to Pipe character in Markdown tables causes the cell to be split into multiple cells 2026-10-21 12:32:29 +02:00
jakob.scheid moved this to Done in Project Board on 2026-10-21 12:33:23 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Total Time Spent: 33 minutes
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jCloud/jcloud-docsgen#70