Skip to content
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 to Mastodon User Profiles in Talk descriptions are not becoming HTML <a>. #503

Closed
MacLemon opened this issue Sep 12, 2018 · 7 comments
Closed

Comments

@MacLemon
Copy link
Contributor

@MacLemon MacLemon commented Sep 12, 2018

Expected Behavior

Since Links in a talk description are becoming actual HTML links with <a> Tags, I expect this to work for all links.

Current Behavior

Example Talk: https://talks.mrmcd.net/2018/talk/BRP77N/
This link Fediverse/Mastodon: https://chaos.social/@MacLemon is not becoming a link. Probably due to the @ in the link text.

Steps to Reproduce

  1. Edit Talk description
  2. Add link to your Mastodon user profile
  3. Save
  4. Check the talk page.

Context

This could also be an upstream issue in Django.

Your Environment

  • Version used: Unknown, whatever revision MRMCD.net ist running as of 2018-09-12 14:00
  • Environment name and version (e.g. Chrome 39, python 3.5): Browser independent
  • Operating System and version (desktop or mobile): macOS Desktop (irrelevant, is a server side issue)
  • Link to your instance, if in production: Observed at https://talks.mrmcd.net/
@MacLemon
Copy link
Contributor Author

@MacLemon MacLemon commented Sep 12, 2018

Caveat lector: I haven't yet tried URL encoding the @ to %40.

@luto
Copy link
Member

@luto luto commented Sep 12, 2018

The problem seems to be the .social, not the @:

>>> import bleach
>>> bleach.linkify('Fediverse/Mastodon: https://chaos.social/@bla')
'Fediverse/Mastodon: https://chaos.social/@bla'
>>> bleach.linkify('Fediverse/Mastodon: https://chaos.de/@bla')
'Fediverse/Mastodon: <a href="https://chaos.de/@bla" rel="nofollow">https://chaos.de/@bla</a>'

@luto
Copy link
Member

@luto luto commented Sep 12, 2018

ah, yes. The TLD list of the underlying library is a litte short: bleach/linkifier.py#L14.

@rixx
Copy link
Member

@rixx rixx commented Sep 12, 2018

Not maintaining a list of TLDs is a choice by the bleach project. We could substitute or expand by our own domain list (as per mozilla/bleach#367 (comment)), but I'm not sure that this poses a development overhead I'd like to maintain.

@luto
Copy link
Member

@luto luto commented Sep 12, 2018

good thing someone else already maintains that list as a python module: https://pypi.org/project/publicsuffixlist/ :)

@rixx
Copy link
Member

@rixx rixx commented Sep 12, 2018

Good point, thank you!

In the meantime, @MacLemon could of course also use markdown syntax to generate working links: [https://chaos.social/@MacLemon](https://chaos.social/@MacLemon)

@MacLemon
Copy link
Contributor Author

@MacLemon MacLemon commented Sep 12, 2018

I had already thought about using Markdown to try that, but haven't found the time to do so, yet. :-)

I can confirm that the Markdown workaround for .sociallinks works perfectly fine. \o/

@rixx rixx closed this in 597fe99 Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants