amigo icon indicating copy to clipboard operation
amigo copied to clipboard

Removes JXON use for native DOMParser for Pubmed abstract parsing

Open AlexanderNull opened this issue 1 year ago • 4 comments

fixes #655

First time touching this codebase so tried to keep changes as minimal as possible. Line indentation looks a bit off as it appears there was a previous mix of tabs and spaces on the older code. Didn't attempt to change that as it should be addressed in a larger formatting once over changeset if needed.

As for the changes I did make: JXON was having some difficulties with the returned titles and abstracts for certain articles as uncovered in the linked AmiGO issue. Replacing the out of date JXON library with the native DOMParser module provides more control over the return type formatting and does not break on instance of embedded html tags in the results as JXON was breaking.

Went the route here to use each node's textContent value instead of innerHTML values to provide default stripping of those html tags. If it is instead desired to maintain Pubmed's inconsistent use of tags then innerHTML can be called instead.

Didn't find tests related to this page and @kltm advised that getting this running locally is a bit daunting to leaving this in their capable hands for now.

AlexanderNull avatar May 19 '23 21:05 AlexanderNull