-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
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
linkValidation escapes hash after a query string #1237
Labels
Comments
kevindew
added a commit
to kevindew/medium-editor
that referenced
this issue
Dec 9, 2016
Fix for: yabwe#1237 Previously URIs were split at a question mark to determine path and query components. This caused a problem when fragments were part of a link as they were deemed to be part of the query. This splits a URL at a ? and a # to get both components and does not encode the fragment. It did feel a little wrong not to encode the fragment at all as there some characters that should be encoded, however the encodeUriComponent method is too heavy handed for a fragment.
kevindew
added a commit
to kevindew/medium-editor
that referenced
this issue
Dec 9, 2016
Fix for: yabwe#1237 Previously URIs were split at a question mark to determine path and query components. This caused a problem when fragments were part of a link as they were deemed to be part of the query. This splits a URL at a ? and a # to get both components and does not encode the fragment. It did feel a little wrong not to encode the fragment at all as there some characters that should be encoded, however the encodeUriComponent method is too heavy handed for a fragment.
kevindew
added a commit
to kevindew/medium-editor
that referenced
this issue
Dec 9, 2016
Fix for: yabwe#1237 Previously URIs were split at a question mark to determine path and query components. This caused a problem when fragments were part of a link as they were deemed to be part of the query. This splits a URL at a ? and a # to get both components and does not encode the fragment. It did feel a little wrong not to encode the fragment at all as there some characters that should be encoded, however the encodeUriComponent method is too heavy handed for a fragment.
Fixed via #1257 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
If I set
linkValidation: true
option, the hash in this valid URLhttp://example.com?query=value#anchor
will be escaped, though it should not. This is not happening with these URLs though:http://example.com?query#anchor
&http://example.com?query1&query2#anchor
. So it feels like the=
is causing the problem.Steps to reproduce
linkValidation: true
optionhttp://example.com?query=value#anchor
Expected behavior: Hyperlink should point to
http://example.com?query=value#anchor
Actual behavior: Hyperlink points to
http://example.com?query=value%23anchor
Link to an example:
Add this ULR as hyperlink
http://example.com?query=value%23anchor
herehttp://codepen.io/websirnik/pen/NREQEZ
Versions
The text was updated successfully, but these errors were encountered: