Skip to content

Add support for linking XMPP URIs in toots#12709

Merged
Gargron merged 3 commits intomastodon:masterfrom
ClearlyClaire:features/xmpp-uri
Jan 11, 2020
Merged

Add support for linking XMPP URIs in toots#12709
Gargron merged 3 commits intomastodon:masterfrom
ClearlyClaire:features/xmpp-uri

Conversation

@ClearlyClaire
Copy link
Copy Markdown
Contributor

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).

This PR also fixes a minor issue with the valid_url regex, which contained an additional numbered group that shouldn't have been there.

Fixes mastodon#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).
@ClearlyClaire ClearlyClaire marked this pull request as ready for review December 29, 2019 21:12
@Gargron Gargron merged commit ea436b3 into mastodon:master Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants