stack icon indicating copy to clipboard operation
stack copied to clipboard

Text is incorrectly considered LaTeX

Open G-Rath opened this issue 9 months ago • 1 comments

Describe the bug Sometimes text is very small and written in a fancy font...

https://retrocomputing.stackexchange.com/questions/31473/reading-a-key-in-msx-without-blocking

To Reproduce Steps to reproduce the behavior:

  1. Have a question that uses $ in someway
  2. Sometimes it'll look funny, and I'm pretty sure it's cause it's getting LaTeX

Expected behavior The text to be rendered plainly

Screenshots If applicable, add screenshots to help explain your problem.

https://files.slack.com/files-pri/T025T9LHG-F08KNAL4FAR/screenshot_2025-03-28-16-46-57-784_me.tylerbwong.stack.jpg

Device Info (please complete the following information):

  • Device: Redmi Note 12
  • OS: MIUI Global 14.0.3, Android 12
  • Browser: Chrome
  • Version:

Additional context I've seen this a number of times but never gotten around to digging into it, but am finally getting around to making an issue and will try to dig into it next month, maybe 😅

I've not yet actually dug into the reproduction but after seeing https://github.com/tylerbwong/stack/commit/e9a1a0e6edc75c2d2f6ce0e946b29d3f9019475f#diff-b2f6cda8173123dbe9526a48f2ed496680a0acee69c555940da10e1e0fd2c9bdR34 and how this presents, I'm pretty sure this is the LaTeX support being bugged

G-Rath avatar Mar 28 '25 03:03 G-Rath

@tylerbwong I had an initial look at this and it seems that LaTeX is actually only supported on the Math exchanges so I think part of the solution here would be to restrict when LaTeX is actually supported.

My ideas for that are:

  • disable/enable for questions from the math exchanges specifically
  • have a list of exchanges as a setting, which included the math exchanges by default but meant users could add additional exchanges (and maybe stuff like beta sites?)
  • have a single global setting that users could toggle based on their preference

While that last one is the least ideal, I would expect it to be the easiest to implement and would really help users like me who are more interested in 98% of the other stackexchanges.

Unfortunately, I've not been able to figure out how to do any of these as it looks like the processing happens via a plugin and that the markdown renderer is injected from another package? it seems very reasonable, but I couldn't figure out how to approach making a plugin conditional based on question data.

I'm happy to have a crack at this but at this point would need some pointers from you as to where to look.

Note I've not looked much into the actual LaTeX side of things - I suspect based on this & #107 that there is something buggy there, and it could be that the matcher is not following the spec, but I wouldn't be surprised if that's a longer piece of work than what I've described above; still happy to look into that too if you'd prefer.

G-Rath avatar Mar 29 '25 20:03 G-Rath