extract attempts to perform a decodeURIComponent on a URL before running the ref regexp against it.
The problem is that sometimes IDs can be URL decoded even when they were not encoded in the first place (e.g. ID starts with a number %09Vq6Fa0zhyq9KH6dYMc/g17L04jDbl1py8arGQmL1I=.sha256 becomes \tVq6Fa0zhyq9KH6dYMc/g17L04jDbl1py8arGQmL1I=.sha256).
This means that these URLs are not detected as links.
This PR fixes the bug by first checking to see if the URL matches the regexp before URL decoding. All tests pass.
extract
attempts to perform adecodeURIComponent
on a URL before running the ref regexp against it.The problem is that sometimes IDs can be URL decoded even when they were not encoded in the first place (e.g. ID starts with a number
%09Vq6Fa0zhyq9KH6dYMc/g17L04jDbl1py8arGQmL1I=.sha256
becomes\tVq6Fa0zhyq9KH6dYMc/g17L04jDbl1py8arGQmL1I=.sha256
).This means that these URLs are not detected as links.
This PR fixes the bug by first checking to see if the URL matches the regexp before URL decoding. All tests pass.
Merging in 3, 2 ...