]> cat aescling's git repositories - mastodon.git/commit
Add support for linking XMPP URIs in toots (#12709)
authorThibG <thib@sitedethib.com>
Sat, 11 Jan 2020 01:15:25 +0000 (02:15 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 11 Jan 2020 01:15:25 +0000 (02:15 +0100)
commitea436b355bd844c86a4f4ddfd204b9bf15a1db6c
treec33fd5501bf295573665740481a6d749a57bab35
parente9ea09d17398763ead69ca845c7aefebf266d373
Add support for linking XMPP URIs in toots (#12709)

* Fix wrong grouping in Twitter valid_url regex

* Add support for xmpp URIs

Fixes #9776

The difficult part is autolinking, because Twitter-text's extractor does
some pretty ad-hoc stuff to find things that “look like” URLs, and XMPP
URIs do not really match the assumptions of that lib, so it doesn't sound
wise to try to shoehorn it into the existing regex.

This is why I used a specific regex (very close, although slightly more
permissive than the RFC), and a specific scan function (a simplified version
of the generalized one from Twitter).

* Remove leading “xmpp:” from auto-linked text
app/lib/formatter.rb
app/lib/sanitize_config.rb
config/initializers/twitter_regex.rb
spec/lib/formatter_spec.rb