Skip to content

Commit a30c0ad

Browse files
fix: prevent HTML escaping in markdown table cells with multiline content (#23)
The previous fix (PR #22) replaced newlines with <br> tags, but wrapping them in backticks caused HTML escaping (&lt;br&gt; instead of line breaks). This fix conditionally removes backticks when content contains HTML tags, allowing proper line break rendering in markdown tables while preserving code formatting for non-HTML content. Fixes the rendering issue reported at: https://robinmordasiewicz.github.io/f5xc-api-fixed/#apiconfignamespacesnamespaceapi_discoverysname Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 5a02ae3 commit a30c0ad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/generate_docs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ def _format_value(value) -> str:
169169
)
170170
# Replace newlines with HTML line breaks for markdown tables
171171
str_value = str(value).replace("\n", "<br>")
172+
# Don't wrap in backticks if it contains HTML (backticks escape HTML entities)
173+
if "<br>" in str_value:
174+
return str_value
172175
return f"`{str_value}`"
173176

174177

0 commit comments

Comments
 (0)