generated from jCloud/repository-template
Merge pull request 'Fix(markdown): escape sequences for pipe characters in table cells' (#71) from fix/markdown-table-cells-pipe into main
Generate API reference / generate (push) Successful in 22s
Generate API reference / generate (push) Successful in 22s
Reviewed-on: #71
This commit was merged in pull request #71.
This commit is contained in:
5 files changed
+85
-11
No files matched your search
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Escape sequences for pipe characters in values of Markdown table cells
|
||||||
|
|
||||||
## [0.2.2] - 2026-10-14
|
## [0.2.2] - 2026-10-14
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -263,11 +263,13 @@ def _markdown_table(
|
|||||||
'| '
|
'| '
|
||||||
+ ' | '.join(
|
+ ' | '.join(
|
||||||
[
|
[
|
||||||
str(col if col is not None else missing_value).replace(
|
str(col if col is not None else missing_value)
|
||||||
'\n', ' '
|
.replace('\n', ' ')
|
||||||
)
|
.replace('|', '\\|')
|
||||||
if one_line_values
|
if one_line_values
|
||||||
else str(col if col is not None else missing_value)
|
else str(
|
||||||
|
col if col is not None else missing_value
|
||||||
|
).replace('|', '\\|')
|
||||||
for col in row
|
for col in row
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ Return type: `User`
|
|||||||
| `user_id` | `str` | normal | -- | -- |
|
| `user_id` | `str` | normal | -- | -- |
|
||||||
| `name` | `str` | normal | -- | -- |
|
| `name` | `str` | normal | -- | -- |
|
||||||
| `email` | `str` | normal | -- | -- |
|
| `email` | `str` | normal | -- | -- |
|
||||||
| `age` | `int | None` | normal | `None` | -- |
|
| `age` | `int \| None` | normal | `None` | -- |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -250,8 +250,8 @@ Return type: `int | float`
|
|||||||
|
|
||||||
| Parameter | Type | Kind | Default value | Description |
|
| Parameter | Type | Kind | Default value | Description |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| `a` | `int | float` | normal | -- | The first number. |
|
| `a` | `int \\| float` | normal | -- | The first number. |
|
||||||
| `b` | `int | float` | normal | -- | The second number. |
|
| `b` | `int \\| float` | normal | -- | The second number. |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -461,8 +461,8 @@ Return type: `int | float`
|
|||||||
|
|
||||||
| Parameter | Type | Kind | Default value | Description |
|
| Parameter | Type | Kind | Default value | Description |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| `a` | `int | float` | normal | -- | The first number. |
|
| `a` | `int \\| float` | normal | -- | The first number. |
|
||||||
| `b` | `int | float` | normal | -- | The second number. |
|
| `b` | `int \\| float` | normal | -- | The second number. |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -672,8 +672,8 @@ Return type: `int | float`
|
|||||||
|
|
||||||
| Parameter | Type | Kind | Default value | Description |
|
| Parameter | Type | Kind | Default value | Description |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| `a` | `int | float` | normal | -- | The first number. |
|
| `a` | `int \\| float` | normal | -- | The first number. |
|
||||||
| `b` | `int | float` | normal | -- | The second number. |
|
| `b` | `int \\| float` | normal | -- | The second number. |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -138,6 +138,72 @@ from src.jcloud_docsgen.core.python._core import _markdown_table
|
|||||||
"""| a |
|
"""| a |
|
||||||
| --- |
|
| --- |
|
||||||
| line1\nline2 |""",
|
| line1\nline2 |""",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
['a'],
|
||||||
|
[('line1\nline2 | 2',)],
|
||||||
|
True,
|
||||||
|
False,
|
||||||
|
False,
|
||||||
|
'--',
|
||||||
|
"""| a |
|
||||||
|
| --- |
|
||||||
|
| line1\nline2 \\| 2 |""",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
['a'],
|
||||||
|
[('line1\nline2 | 2',)],
|
||||||
|
True,
|
||||||
|
False,
|
||||||
|
True,
|
||||||
|
'--',
|
||||||
|
"""| a |
|
||||||
|
| --- |
|
||||||
|
| line1 line2 \\| 2 |""",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
['a'],
|
||||||
|
[('1 | 2',)],
|
||||||
|
True,
|
||||||
|
False,
|
||||||
|
True,
|
||||||
|
'--',
|
||||||
|
"""| a |
|
||||||
|
| --- |
|
||||||
|
| 1 \\| 2 |""",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
['a'],
|
||||||
|
[('1 |',)],
|
||||||
|
True,
|
||||||
|
False,
|
||||||
|
True,
|
||||||
|
'--',
|
||||||
|
"""| a |
|
||||||
|
| --- |
|
||||||
|
| 1 \\| |""",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
['a'],
|
||||||
|
[('|',)],
|
||||||
|
True,
|
||||||
|
False,
|
||||||
|
True,
|
||||||
|
'--',
|
||||||
|
"""| a |
|
||||||
|
| --- |
|
||||||
|
| \\| |""",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
['a'],
|
||||||
|
[('| 2',)],
|
||||||
|
True,
|
||||||
|
False,
|
||||||
|
True,
|
||||||
|
'--',
|
||||||
|
"""| a |
|
||||||
|
| --- |
|
||||||
|
| \\| 2 |""",
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
[],
|
[],
|
||||||
|
|||||||
Reference in new issue
Block a user