Closed as2648as closed 1 year ago
Using the following in Twitch /w BTTV: asdfasdfasd❤️🔥 sdfgsdfg :( gdsfgsdfg
stripemoji + striphtml:
stripemoji:
striphtml
nothing added:
The unhappy face is replaced by an Image by BTTV, and that gets removed with using &striphtml. I do not know if an image is an emoji or something else.
An emoji when using &stripemoji is a non-alphanumeric unicode character, representing an image, but not HTML. -- it's just text. Some fonts render emojis right; some don't.
To get rid of both images and text-based emojis, you'd need to use striphtml + stripemoji. It seems to work in my testing.
I'm open to considering treating all images as emojis, but I don't assume that in this case.
Okay, I misunderstood the purpose of these features at first.
Perhaps in the future, I will add or modify some text processing features in a new branch, such as:
Only remove emoticons using the <img>
element
This allows text to include elements such as underline, strikethrough, blue URLs, etc.
Remove Unicode emojis
Such as expressions 😊, symbols 🎶, items 🚗, etc.
Remove URLs
- When TTS is enabled, reading out URLs may cause trouble. Another solution is to add additional checks in TTS.
- URLs are just too long.
The reason I want to make these improvements is that some people may not want many graphics in the chat room after using emote.html
.
In addition, having more options means users can choose what they need more flexibly.
Looking forward to your reply.
By the way, as far as I know, "emoji", "emoticon", and "emotes" have different meanings in English.
Perhaps my choice of words may cause confusion, sorry about that.
@steveseguin I've implemented the features mentioned in the latest comment and written some code for it. Since it's easier to test on custom.js and these features may not be merged into the main branch, I'm sharing my code here in hopes that it might inspire you with some ideas.
Thank you, kindly. I'll dig into it
Hello, I would like to inquire about the parameters
&striphtml
and&stripemoji
.I believe the functionality of
&striphtml
and&stripemoji
is to help users remove any HTML and emoji from chat messages. Is my understanding correct? The current test results do not seem to support this idea. As shown in the image below, the Twitch popout is what I would expect, but thedock.html
is what is currently being displayed.Building on the previous question, I observed in the developer tools that the message retrieval in
twitch.js
seems to include html elements, which can affect the functionality ofstripHtmlFunction
when&striphtml
is enabled but&stripemoji
is not. This is becausestripHtmlFunction
removes html elements, but Twitch and Youtube's emojis are presented using<img>
.We can use this post for the
stripemoji
parameter and add code to check for<img>
elements to more accurately replace emoji elements.