-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Emojify spoiler and content in web templates #785
Emojify spoiler and content in web templates #785
Conversation
6802f86
to
abc89cb
Compare
added an emoji class, reused the EmojiFinder regex, and escaped the spoiler text before emojifying it, since escaping the spoiler text would have been the original behaviour of the template |
abc89cb
to
1ed3cca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty cool and I'm excited to try it out :) just a few small comments
I noticed that .Content gets sent through noescape, but not .SpoilerText. Should SpoilerText be html escaped
the reason we put .Content through noescape is because .Content is html, so we want it to render as such
.SpoilerText is always sanitized to plaintext with no HTML in it, so we don't need to pass it through the noescape function. Ah, but I see in this PR you're making it so that spoilertext can contain html because it can contain emojis... is that correct? [edit] I misunderstood :D I think this looks fine then!
7e24d91
to
06d1c04
Compare
This looks good to me! Maybe another quick once over from @tsmethurst as they know our templating system better than me and should be good to merge :) |
nice, thank you!! :) |
Nice one :) very excited for getting a step closer to proper emoji support, thanks for all your hard work! I'll have a look over this tomorrow
Sent from ProtonMail mobile
…-------- Original Message --------
On Sep 1, 2022, 7:01 PM, kim wrote:
This looks good to me! Maybe another quick once over from ***@***.***(https://github.com/tsmethurst) as they know our templating system better than me and should be good to merge :)
—
Reply to this email directly, [view it on GitHub](#785 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AHT24I54PFQC6QAZGSZ7RSTV4DOP7ANCNFSM6AAAAAAQA3CBEI).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
fixes #648
funny enough, emojification bugs were one of the first things I worked on for mastodon 5 years ago
probably my most complicated commit so far, the creation of the regex and template can maybe be optimized?
emojify takes a template.HTML parameter for the text because it assumes that everything is already escaped, and its output can't be escaped again or it will destroy the img tags. I noticed that .Content gets sent through noescape, but not .SpoilerText. Should SpoilerText be html escaped?
the "emoji" css class still needs to be made, not sure where to put it