This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new c917a6e60d3 HDDS-15260. Escape more elements in xml_to_md.py (#10311)
c917a6e60d3 is described below
commit c917a6e60d36e0c5b628ab93cc80feaf10c590ff
Author: Sarveksha Yeshavantha Raju
<[email protected]>
AuthorDate: Tue May 19 18:38:23 2026 +0530
HDDS-15260. Escape more elements in xml_to_md.py (#10311)
---
dev-support/ci/xml_to_md.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dev-support/ci/xml_to_md.py b/dev-support/ci/xml_to_md.py
index d299e3365e6..c2e80dce9dc 100644
--- a/dev-support/ci/xml_to_md.py
+++ b/dev-support/ci/xml_to_md.py
@@ -27,6 +27,15 @@
Property = namedtuple('Property', ['name', 'value', 'tag', 'description'])
+def escape_mdx_markup(text):
+ """Escapes special characters to prevent MDX/JSX parsing errors."""
+ if not text:
+ return text
+ text = text.replace('&', '&')
+ text = text.replace('<', '<')
+ text = text.replace('>', '>')
+ return text
+
def extract_xml_from_jar(jar_path, xml_filename):
xml_files = []
with zipfile.ZipFile(jar_path, 'r') as jar:
@@ -120,6 +129,7 @@ def generate_markdown(properties):
# Escape pipe characters and wrap {placeholders} in backticks
description = prop.description.replace('|', '\\|')
description = placeholder_pattern.sub(r'`\1{\2}`', description)
+ description = escape_mdx_markup(description)
value = prop.value
if value:
@@ -127,6 +137,7 @@ def generate_markdown(properties):
value = placeholder_pattern.sub(r'`\1{\2}`', value)
value = value.replace('\n', ' ')
value = multi_space_pattern.sub(' ', value)
+ value = escape_mdx_markup(value)
markdown += f"| `{prop.name}` | {value} | {prop.tag} | {description} |\n"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]