Removes JXON use for native DOMParser for Pubmed abstract parsing #685
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofinnerHTML
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.