bot icon indicating copy to clipboard operation
bot copied to clipboard

Newline antispam filter potentially handles actual rendered lines of formatting incorrectly

Open thatbirdguythatuknownot opened this issue 1 year ago • 4 comments

Due to a recent incident, it is very important to note the need to special-case codeblocks' newline count for the antispam filter. image It is important to note that, as shown in the image, a codeblock renders about 2 extra lines worth of space compared to a regular text line. It is also recommended to special-case headers, as they make text a lot larger than usual (although I haven't computed it yet).

thatbirdguythatuknownot avatar Apr 30 '24 00:04 thatbirdguythatuknownot

There's quite a lot of features of this bot that interact with codeblocks, so this issue doesn't give us much to go off of for potentially fixing what you believe to be incorrect.

Could you specify where we should special case this count?

It might be easier if you provide reproduction steps, what the expected behaviour is, and what the current behaviour is.

If you believe this is an exploitable bug and shouldn't be discussed publicly, please follow our security notice

ChrisLovering avatar Apr 30 '24 07:04 ChrisLovering

There was recently an incident with spam in #python-discussion where a user sent a lot of backticks that turned into codeblocks that flooded the chat. I think the relevant code is here.

thatbirdguythatuknownot avatar Apr 30 '24 08:04 thatbirdguythatuknownot

So just to be clear then, this issue is related to the new lines filter potentially not working correctly for messages with backticks?

If so, could you update the original description & title to reflect that?

ChrisLovering avatar Apr 30 '24 11:04 ChrisLovering

Yup.

thatbirdguythatuknownot avatar Apr 30 '24 11:04 thatbirdguythatuknownot