Formatting characters may be grouped in Trigger
in a surprising way
#2590
Labels
Bug
Things to squish; generally used for issues
Trigger
in a surprising way
#2590
Description
@dgw discovered that my Sopel instance's Unicode plugin was not recognizing italics in a message, even though bold is recognized just fine.
Where
s = trigger.group(3)
It seems that this is because
"\x02".isspace()
isFalse
and"\x1d".isspace()
isTrue
, so the latter is swallowed up into some of the\s
baked into the rule automatically generated by Sopel when using@plugin.commands()
As a workaround, I have done the following in that plugin to get a more accurate reflection of the argument (while still ignoring spaces which are not interesting to that plugin's functionality):
Reproduction steps
Write a command that would care to accept italic text, then observe that the formatting character is not in the
groups()
of the resultingTrigger
.Expected behavior
I would expect formatting characters to be treated as if they were normal text.
Relevant logs
No response
Notes
No response
Sopel version
973a489
Installation method
pip install
Python version
3.9.16
Operating system
Ubuntu 20.04
IRCd
No response
Relevant plugins
No response
The text was updated successfully, but these errors were encountered: