We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not sure why linkValidation is encoding the URL?
linkValidation
medium-editor/src/js/extensions/anchor.js
Line 246 in d880685
anchor
linkValidation: true
http://site.com/?q=http%3A%2F%2Fsite2.com
Expected behavior: Text should have a link as entered: <a href="http://site.com/?q=http%3A%2F%2Fsite2.com">text</a>
<a href="http://site.com/?q=http%3A%2F%2Fsite2.com">text</a>
Actual behavior: Link is encoded: <a href="http://site.com/?q=http%253A%252F%252Fsite2.com">text</a>
<a href="http://site.com/?q=http%253A%252F%252Fsite2.com">text</a>
The text was updated successfully, but these errors were encountered:
Might be related to #1025
It's mostly to handle url that contains spaces. Maybe we should go with value.replace(/\s/g, '%20') to only replace spaces?
value.replace(/\s/g, '%20')
Sorry, something went wrong.
Looks like it used to be a regex like that: 5a9f383
If spaces are encoded, then everything should probably be encoded.
Hmm, the solution might be to check if the URL was already encoded, and then only encode if it was not already encoded.
No branches or pull requests
Description
Not sure why
linkValidation
is encoding the URL?medium-editor/src/js/extensions/anchor.js
Line 246 in d880685
Steps to reproduce
anchor
button withlinkValidation: true
http://site.com/?q=http%3A%2F%2Fsite2.com
Expected behavior:
Text should have a link as entered:
<a href="http://site.com/?q=http%3A%2F%2Fsite2.com">text</a>
Actual behavior:
Link is encoded:
<a href="http://site.com/?q=http%253A%252F%252Fsite2.com">text</a>
Versions
The text was updated successfully, but these errors were encountered: