Closed bubble1001 closed 1 year ago
Hello, My main problem with this is that it completely removes the URL encoding, so it does not only prevent double encoding but removes it completely.
So, potentially URL-breaking characters could break the link.
As far as I see, there is also a cleaning regex that removes the URL-breaking characters, I tried a couple of common ones like ,#?&/, and they all seemed to work correctly.
But I still have a feeling that probably URL encoding was added here for some reason :D So I would be ok with adding it as a config option, not to break any backward compatibility, just in case.
If you are okay to add a config check, like
if (docdash.noURLEncode) {
url = decodeURI(url);
}
I will merge and release it :)
About the issue 'https://github.com/clenemt/docdash/issues/118', when I modify it like this, the previous problem will not appear. The url got in line 672 is already encoded, but the registerLink function requires an unencoded url