Skip to content

Commit 57a0897

Browse files
committed
Make publisher gracefully skip unparseable XML files
Some pre-existing XML files in lib/engine/ contain mathematical operators in tag names (e.g., <×>, <∘>) which aren't valid XML. These files existed before the validator implementation. Instead of failing the entire publish job, skip these files with a warning and continue processing other valid XML files. This preserves existing XML examples intact while allowing the publisher to successfully generate documentation for valid files.
1 parent 0ac1d29 commit 57a0897

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/xml_lib/publisher.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ def publish(self, project_path: Path, output_dir: Path) -> PublishResult:
218218
output_file.write_bytes(bytes(html))
219219
result.files.append(str(output_file))
220220

221+
except etree.XMLSyntaxError as e:
222+
# Skip files with invalid XML (e.g., mathematical operators in tags)
223+
# These are pre-existing files in lib/engine with special content
224+
print(f"Warning: Skipping {xml_file} - XML parse error: {e}")
225+
continue
226+
221227
except Exception as e:
222228
result.success = False
223229
result.error = f"Failed to transform {xml_file}: {e}"

0 commit comments

Comments
 (0)