Strip spoiler tags for watchlist triggers#530
Conversation
eivl
left a comment
There was a problem hiding this comment.
do we want to match
n||F||o||U||t||C||h||K||i||Y||n||O||g||U||
|
I played around and wrote a possible method to split things up into "interpretations" of text messed up with spoilers: SPOILER_RE = re.compile(r"\|\|", re.DOTALL)
def process_spoilers(text):
split_text = SPOILER_RE.split(text)
public_text = "".join(split_text[0:][::2])
spoiler_text = "".join(split_text[1:][::2])
cleaned_text = "".join(split_text)
return public_text, spoiler_text, cleaned_text@eivl's example would give: ('nothing', 'FUCKYOU', 'nFoUtChKiYnOgU') |
|
Thanks @scragly, I'll add it in |
|
@AnonGuy what's the status on this? is it done? it's still labeled WIP. |
|
@AnonGuy Looks like this is a good start, but there are multiple cases that this PR does not resolve, so it feels a bit like a half measure. This PR does catch the simplest, For example, have a look at this embed: Sure, the filter does match it, but the username is spoilered, the location has spoilers, and the original message has spoilers. It would be better her to display these with the pipes escaped. Can we add a
|
eivl
left a comment
There was a problem hiding this comment.
looks fine, just surprised that there are no more changes then this :D
lemonsaurus
left a comment
There was a problem hiding this comment.
hell yeah, let's merge this bad boy

Closes #299