elifesciences / elife-tools

Python library for parsing eLife article XML data.
MIT License
15 stars 7 forks source link

remove_tag() and remove_tag_and_text() #329

Closed gnott closed 4 years ago

gnott commented 4 years ago

Starting from adding structured abstract enhancements to the https://github.com/elifesciences/elife-crossref-xml-generation project, continuing on to enhancing https://github.com/elifesciences/elife-pubmed-xml-generation I needed to use these two tag removal functions to alter the abstract XML.

For reuse and to reduce duplicate code, I think the best home for these two functions, remove_tag() and remove_tag_and_text(), will be here in the utils.py module.

I added test scenarios specifically for these two functions based on some real examples containing new line characters and one imagined edge case.

These are all new functions with no backwards compatibility risks.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.0006%) to 99.713% when pulling f955404458073891cc5ca1264bd6ee18c954dec8 on remove-tag into 1b5496657e0e35005e066ee3fe7bf49b81138f8e on develop.