From 19262e799a7923bec5403d89c7e0e34fa61abeab Mon Sep 17 00:00:00 2001 From: sarvekshayr Date: Sat, 28 Feb 2026 10:58:15 +0530 Subject: [PATCH 1/2] HDDS-14736. Fix the {...} issue in xml_to_md.py and rename appendix.md. --- .github/workflows/update-ozone-site-config-doc.yml | 2 +- dev-support/ci/xml_to_md.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-ozone-site-config-doc.yml b/.github/workflows/update-ozone-site-config-doc.yml index 73c839c14d7c..e5196778a4ad 100644 --- a/.github/workflows/update-ozone-site-config-doc.yml +++ b/.github/workflows/update-ozone-site-config-doc.yml @@ -73,7 +73,7 @@ jobs: exit 0 fi - TARGET_FILE="$TARGET_DIR/05-appendix.md" + TARGET_FILE="$TARGET_DIR/99-appendix.md" echo "Checking against $TARGET_FILE" # Copy new file to target location diff --git a/dev-support/ci/xml_to_md.py b/dev-support/ci/xml_to_md.py index e3c6ef14ebc6..e01a7fe1dc2f 100644 --- a/dev-support/ci/xml_to_md.py +++ b/dev-support/ci/xml_to_md.py @@ -107,9 +107,11 @@ def generate_markdown(properties): """ for prop in sorted(properties.values(), key=lambda p: p.name): - # Escape pipe characters in description to prevent breaking the table + # Escape pipe characters and wrap {placeholders} in backticks description = prop.description.replace('|', '\\|') - value = prop.value if prop.value else '' + description = re.sub(r'(\$)?\{([^}]+)\}', r'`\1{\2}`', description) + value = prop.value.replace('|', '\\|') if prop.value else '' + value = re.sub(r'(\$)?\{([^}]+)\}', r'`\1{\2}`', value) if value else '' markdown += f"| `{prop.name}` | {value} | {prop.tag} | {description} |\n" From 885f7450cc5469f5a547aefe6be3f2120995b7ba Mon Sep 17 00:00:00 2001 From: sarvekshayr Date: Sat, 28 Feb 2026 12:05:40 +0530 Subject: [PATCH 2/2] re.compile the pattern before the loop --- dev-support/ci/xml_to_md.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev-support/ci/xml_to_md.py b/dev-support/ci/xml_to_md.py index e01a7fe1dc2f..54e885c28337 100644 --- a/dev-support/ci/xml_to_md.py +++ b/dev-support/ci/xml_to_md.py @@ -106,12 +106,14 @@ def generate_markdown(properties): |:-----|:--------------|:-----|:------------| """ + placeholder_pattern = re.compile(r'(\$)?\{([^}]+)\}') + for prop in sorted(properties.values(), key=lambda p: p.name): # Escape pipe characters and wrap {placeholders} in backticks description = prop.description.replace('|', '\\|') - description = re.sub(r'(\$)?\{([^}]+)\}', r'`\1{\2}`', description) + description = placeholder_pattern.sub(r'`\1{\2}`', description) value = prop.value.replace('|', '\\|') if prop.value else '' - value = re.sub(r'(\$)?\{([^}]+)\}', r'`\1{\2}`', value) if value else '' + value = placeholder_pattern.sub(r'`\1{\2}`', value) if value else '' markdown += f"| `{prop.name}` | {value} | {prop.tag} | {description} |\n"