-
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
Links broken if no protocol provided #714
Comments
We should add |
On further inspection, the adding of protocol works if the I'm guessing there should be some consistency between how autoLink and anchor work. |
In fact, the See https://github.com/yabwe/medium-editor/blob/master/src/js/extensions/anchor.js#L208-L211 I think the question is more, should And you're right about consistency about these two extensions. |
The problem here is that So, I don't think these options can be synchronized, however I do think it could be valid for |
Thinking about it, why this kind of feature is disabled by default and why this is an option at all. Since anchor is about to insert a link, why people should insert relative link instead of absolute one? |
I'm guessing having it as an option would still be good. Maybe in some cases you want relative links because the content is supposed to run on different domains (e.g. local and production), or you might be just creating hash links. |
So we'll switch @filipkis you're more than welcome to submit another PR about that 😄 |
For now, I think it will be better to leave things as there are currently, and not have linkValidation turned on by default. I don't think the fact that auto-link requires valid links is a strong reason to make the link extension require protocols on urls. We can definitely revisit this later when there's a better case to be made in favor of it, but for now I'm going to close this issue. Thanks a bunch for raising this, it was definitely worth discussing. |
When inserting links using the anchor toolbar button and typing for instance only www.google.com (instead of full path http://www.google.com) the href of the anchor will only be set to the typed value, which in turn will cause the links to be broken (directing to http://yourapp.com/www.google.com).
The protocol (http://) is nicely added to links that are created automatically (autoLink = true), but not for the ones created from the toolbar.
The text was updated successfully, but these errors were encountered: