Opened 9 years ago

Last modified 7 years ago

#13669 confirmed New Feature

Improve the heuristic for URL recognition in autolink

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: General Version: 4.5.0 Beta
Keywords: Cc:

Description (last modified by Piotrek Koszuliński)

Steps to reproduce

Based on https://twitter.com/l0c0luke/status/633684769121832960

Autolink will not recognise youtu.be/cSVuh_8-VQs as a link, hence autoembed will not find it too. Links without protocols are a common case as browsers hide them in the URL bar.

Expected result

We may try to improve the heuristic so it autolinks such URLs. It may happen that it will start autolinking too much, but links can always be removed, so it should not be a big problem as long as it's not happening for typical plain text.

Change History (3)

comment:1 Changed 9 years ago by Piotrek Koszuliński

Description: modified (diff)
Status: newconfirmed
Summary: Improve heuristic for URL recognition in autolinkImprove the heuristic for URL recognition in autolink

comment:2 Changed 7 years ago by Jakub Ś

From what I have checked autolink will only work when you paste http://o2.pl but not when you paste text http://o2.pl text or http://o2.pl www.o2.pl test.com. It only assumes that user pastes a link and nothing else.

I personally think this is too strict and that we should allow more:

  1. first case is easy - text http://o2.pl text. We just need to remove ^ $ from pattern
  2. Second case I'm not sure - should autolink only recognize links starting with http(s)? or www. as well?

comment:3 Changed 7 years ago by Jakub Ś

Other issues for autolink plugin: #13569, #14769, #16685.

Version 1, edited 7 years ago by Jakub Ś (previous) (next) (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy