Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDOI: Find DOIs in links, and other improvements #2143
Merged
+60
−41
Conversation
Search links in addition to page text, as discussed in the forums [1]. Also: - Make the order of results match the page - Possibly fix an issue where some DOIs could be left out if they appeared within the same text string (lastMatch should've been lastIndex; the former is read-only and non-numeric, so it's not clear that this ever worked) - Simplify the code [1] https://forums.zotero.org/discussion/comment/350735/#Comment_350735
This looks good to me and works -- the new test runs for me too, btw. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
dstillman commentedMar 13, 2020
Search links in addition to page text, as discussed in the forums.
Also:
appeared within the same text string (lastMatch should've been
lastIndex; the former is read-only and non-numeric, so it's not clear
that this ever worked)
Note: I added a test for this, but for some reason it fails via the test runner due to some site cookie issue, even though it works when run manually (and even works when populating the tests). Apparently our handling of cookies is different between tests and manual translation.