Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reddit's superscript markup gets in the way. #1

Open
kindaro opened this issue Nov 26, 2021 · 3 comments
Open

Reddit's superscript markup gets in the way. #1

kindaro opened this issue Nov 26, 2021 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kindaro
Copy link

kindaro commented Nov 26, 2021

See example here. I checked on both new and old Reddit in Firefox. The equation [; \sum_{n=1}^{\infty}{ \frac{1}{n^2} } = \frac{\pi^2}{6} ;] is displayed as LaTeX only when it is put into a code block. If it is put in plain text, the carets get interpreted as Reddit's markup and turned into <sup> tags.

One possible way to solve this is to rewrite all <sup> tags found between the LaTeX delimiters back to LaTeX notation they are supposed to be.

The cheap way to go about it is to simply ask everyone to put their equations into code blocks.

@acarapetis
Copy link
Owner

Our advice on /r/math has always been to use code blocks:

image

As you say, it should be possible to write a heuristic to reverse reddit's markdown renderer (note that we also need to worry about asterisks, underscores, tildes and maybe some other things I'm forgetting...), but it would mean detecting the LaTeX delimiters ourself rather than relying on MathJax to do that for us.

Very happy to review a PR if someone else wants to try implementing this, but I don't have the time to do it myself.

@kindaro
Copy link
Author

kindaro commented Nov 26, 2021

For the time being, maybe the documentation should say that the delimiters are actually `[; … ;]` and `(; … ;)`? This is what we expect the user to actually type.

(Am I accidentally drawing cute emoji monsters?)

@acarapetis
Copy link
Owner

Fair point, I'll update the readme :)

@acarapetis acarapetis added enhancement New feature or request help wanted Extra attention is needed labels Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants