Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocoto XML regex fix #643

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/uwtools/rocoto.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __str__(self) -> str:
xml = etree.tostring(
self._root, pretty_print=True, encoding="utf-8", xml_declaration=True
).decode()
xml = re.sub(r"&([^;]+);", r"&\1;", xml)
xml = re.sub(r"&([^&]+;)", r"&\1", xml)
xml = self._insert_doctype(xml)
return xml

Expand Down
6 changes: 3 additions & 3 deletions src/uwtools/tests/fixtures/hello_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ workflow:
task_hello:
attrs:
cycledefs: howdy
maxtries: "2"
maxtries: 2
account: "&ACCOUNT;"
command: "echo hello $person"
command: "echo account for $person is &ACCOUNT; && true"
maddenp-noaa marked this conversation as resolved.
Show resolved Hide resolved
jobname:
cyclestr:
attrs:
Expand All @@ -34,7 +34,7 @@ workflow:
task_hello_#member#:
attrs:
cycledefs: howdy
maxtries: "1"
maxtries: 1
account: "&ACCOUNT;"
command: "echo hello #member#"
nodes: 1:ppn=1
Expand Down
Loading