xkcd-Bucket icon indicating copy to clipboard operation
xkcd-Bucket copied to clipboard

Possible unwanted whitespace removal in tidbits

Open dgw opened this issue 9 years ago • 1 comments

A meme currently going around the fanbase of a certain anime franchise proved impossible to replicate faithfully in a Bucket response. Observe the following:

<dgw> Kaede: it's joke <reply> I T S   J O K E
<Kaede> dgw taught in #Kaede (#4886): 'it's joke', '<reply>', 'I T S J O K E'

The extra whitespace is part of the meme, but is removed before the tidbit is saved.

I think it's because of sub irc_on_public performing the following replacement before processing an incoming line:

    $msg =~ s/\s\s+/ /g;

Is there a downside to moving this substitution later in the chain of processing, so teaching operations can learn tidbits verbatim (using &decommify or similar to clean the fact part)? Or is it actually caused somewhere else?

dgw avatar Aug 23 '16 06:08 dgw

Maybe.

You'd have to still keep it for the trigger part, but removing it from the tidbit should be fine.

On the other hand, other operations (like s/// or other matching) will never be able to match the tidbit, because they'd have their spaces collapsed too.

I suppose the "proper" solution would be to implement quoting, so that bucket would only despace unquoted bits.

zigdon avatar Aug 31 '16 16:08 zigdon