Skip to content

Commit e1b02e7

Browse files
authored
HDDS-14736. Escape {...} in xml_to_md.py, rename appendix.md (#9846)
1 parent 9c50751 commit e1b02e7

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/update-ozone-site-config-doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
exit 0
7474
fi
7575
76-
TARGET_FILE="$TARGET_DIR/05-appendix.md"
76+
TARGET_FILE="$TARGET_DIR/99-appendix.md"
7777
echo "Checking against $TARGET_FILE"
7878
7979
# Copy new file to target location

dev-support/ci/xml_to_md.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,14 @@ def generate_markdown(properties):
106106
|:-----|:--------------|:-----|:------------|
107107
"""
108108

109+
placeholder_pattern = re.compile(r'(\$)?\{([^}]+)\}')
110+
109111
for prop in sorted(properties.values(), key=lambda p: p.name):
110-
# Escape pipe characters in description to prevent breaking the table
112+
# Escape pipe characters and wrap {placeholders} in backticks
111113
description = prop.description.replace('|', '\\|')
112-
value = prop.value if prop.value else ''
114+
description = placeholder_pattern.sub(r'`\1{\2}`', description)
115+
value = prop.value.replace('|', '\\|') if prop.value else ''
116+
value = placeholder_pattern.sub(r'`\1{\2}`', value) if value else ''
113117

114118
markdown += f"| `{prop.name}` | {value} | {prop.tag} | {description} |\n"
115119

0 commit comments

Comments
 (0)