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

Whitelist allowed classes for federated statuses #3810

Merged
merged 2 commits into from
Jun 17, 2017

Conversation

nightpool
Copy link
Member

@nightpool nightpool commented Jun 16, 2017

Allowed classes are currently:

  • Any microformats class (h/p/u/dt/e-*)
  • the classes mention, hashtag, ellipses and invisible.

this last one is somewhat suspect, but Mastodon currently uses it to render truncated links.

Before this pull request gets merged, I would like more input on which classes should be allowed and which should be restricted. For example, I think that fa-spin is fine to be allowed, but I feel weird whitelisting it explicitly. It would be nice to allow some amount of simple formatting (opening the door for things like #853 and #3621 to happen on a federation level), but I don't know what classes we already have that could do similar things.

resolves #3790

Allowed classes are currently:

 - Any microformats class (h/p/u/dt/e-*)
 - the classes mention, hashtag, ellipses and invisible.

this last one is somewhat suspect, but Mastodon currently uses it to render hidden link text.

resolved mastodon#3790
},

transformers: [
CLASS_WHITELIST_TRANSFORMER
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comma (,).

@Gargron Gargron merged commit 94d0e01 into mastodon:master Jun 17, 2017
@nightpool nightpool deleted the class_whitelisting branch June 17, 2017 18:39
koteitan pushed a commit to koteitan/mastodon that referenced this pull request Jun 25, 2017
* Whitelist allowed classes for federated statuses

Allowed classes are currently:

 - Any microformats class (h/p/u/dt/e-*)
 - the classes mention, hashtag, ellipses and invisible.

this last one is somewhat suspect, but Mastodon currently uses it to render hidden link text.

resolved mastodon#3790

* Fix code style
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.

Whitelist classes for HTML elements in statuses
3 participants