mathbot
mathbot copied to clipboard
added spoiler inputs and outputs
added support for using Discord's spoilerizing to the output images via modifications to how the latex raw text is processed
parsed based on the format || {content} ||
, note the space after the start ||
and before the end ||
. This means it still supports using ||
anywhere in the latex, even at the beginning and end, as long as spaces are used when a user wants to mark it as spoiler
example use:
=tex || \|\|a^2+b^2\|\| ||
Looks neat @merukit, however what happens if I do =tex || my text || my other text ||
?
I also see it triggering unexpectedly in cases like =tex Norm of vector X = || X ||
I don't think it will trigger in below example with multiple parallel line segments which is good:
=tex AB || CD || EF
Could you test these? 🙃
Checking for even numbers of ||
or ||
in order to enforce that each one should be paired, in a little bit of a hack-y way. This deals with the edge case of =tex || my text || my other text ||
. Because the message is not entirely spoilered we assume the user just wants three double bars, and don't spoiler the output.
Still exists edge cases on something like =tex || a || a || a ||
. I intended for this syntax to be used without spaces if someone wanted actual pipes instead of spoilers, but if they add spaces it produces unexpected output again. I'm not sure it is worth handling for those edge cases.