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.
Coverage increased (+0.0006%) to 99.713% when pulling f955404458073891cc5ca1264bd6ee18c954dec8 on remove-tag into 1b5496657e0e35005e066ee3fe7bf49b81138f8e on develop.
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()
andremove_tag_and_text()
, will be here in theutils.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.