Skip to content

Conversation

@jgao222
Copy link

@jgao222 jgao222 commented May 19, 2021

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\|\| ||
image
image

@Ytrog
Copy link
Contributor

Ytrog commented May 27, 2021

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? 🙃

@jgao222
Copy link
Author

jgao222 commented May 29, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants