#14769 closed Bug (fixed)
URL with '-' in host not detected by autolink plugin
Reported by: | mpeuss | Owned by: | Tade0 |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.7.0 |
Component: | General | Version: | 4.5.0 |
Keywords: | Cc: |
Description
Steps to reproduce
- enable the autolink plugin
- paste a url with a '-' in the hostname (e.g. http://example-site.org/) into the editor text field
Expected result
url string is converted to a clickable link
Actual result
url is not detected
Change History (14)
comment:1 Changed 8 years ago by
Status: | new → confirmed |
---|---|
Version: | 4.5.10 (GitHub - master) → 4.5.0 |
comment:2 Changed 8 years ago by
#13364 we had similar but it has turned out there was rather a problem in user implementation.
Are you by any chance using any non-standard package with third-party plugins not created by CKSource?
comment:4 Changed 8 years ago by
#14903 was marked as duplicate.
In search of the perfect URL validation regex might help with finding a good regexp.
comment:6 Changed 8 years ago by
Milestone: | → CKEditor 4.7.0 |
---|
It's a super trivial bug, let's have it fixed.
comment:9 Changed 8 years ago by
Owner: | set to Tade0 |
---|---|
Status: | confirmed → review |
comment:10 Changed 8 years ago by
Status: | review → pending |
---|
The fix fixes the issue with not recognizing links with hyphen in them, but it also links invalid links, e.g. http://-invalid-
I'm not sure if it's easily fixable, but we could also consider replacing our current regex with another one. The questions are:
- Do we want to be 100% compliant with the spec?
- Do we want to include big regex instead of our current small one?
@m.lewandowski @Tade0 WDYT?
comment:11 follow-up: 12 Changed 8 years ago by
I think most instances of pasting such an invalid link will be people testing if this particular URL is transformed.
In other words: There are significantly more valid urls with hyphens pasted each day into CKE than weird, invalid links.
Originally I had chosen this particular regex because it strikes a good balance between shortness and correctness.
comment:12 Changed 8 years ago by
Replying to Tade0:
I think most instances of pasting such an invalid link will be people testing if this particular URL is transformed.
In other words: There are significantly more valid urls with hyphens pasted each day into CKE than weird, invalid links.
Originally I had chosen this particular regex because it strikes a good balance between shortness and correctness.
+1 it make sense. I can imagine being unable to paste links with hypens to be far more irritating, than letting some edge cases through.
comment:13 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | pending → closed |
In that case, fix is good enough. Merged with git:f8e830b.
comment:14 Changed 8 years ago by
Summary: | [autolink] URL with '-' in host not detected → URL with '-' in host not detected by autolink plugin |
---|
Problem can be reproduced from CKEditor 4.5.0.