elifesciences / elife-tools

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

Bug fix abstract_xml() to be non-destructive. #325

Closed gnott closed 4 years ago

gnott commented 4 years ago

Bug fix to PR https://github.com/elifesciences/elife-tools/pull/324

After testing this new function in practice, if you call abstract_xml() and other abstract functions on the same soup object, and because abstract_xml() uses clear() to get rid of DOI paragraphs, then the abstract in the soup is altered.

The fix here is to make a copy of the abstract tag object before altering it.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+5.0e-05%) to 99.712% when pulling fe9ece420afea581c4e1860f4a6358d9411763e0 on abstract_xml into cf49daa4ba1bd6acdd81c3dd9f56b0cfc1391a30 on develop.