Skip to content

fix(core): pretty-print XML when a date contains '&' - #370

Closed
amantebriwal4321 wants to merge 1 commit into
geopython:masterfrom
amantebriwal4321:fix/336-pretty-print-ampersand
Closed

amantebriwal4321 wants to merge 1 commit into
geopython:masterfrom
amantebriwal4321:fix/336-pretty-print-ampersand

Conversation

@amantebriwal4321

Copy link
Copy Markdown
Contributor

pretty_print crashed when MCF text such as a creation date contained a bare ampersand, because minidom rejected the XML. Bare ampersands are now escaped before parsing, and existing entities are left unchanged. A regression test covers this. Fixes #336.

Escape bare ampersands before minidom.parseString so interpolating
an unescaped '&' in MCF text, such as a creation date, no longer
crashes pretty_print. Existing entities are left unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pygeometa.core:pretty-printing XML fails with illegal character - if creation date has '&'

2 participants