MathJax נכשל ברינדור מתמטיקה מוטבעת כאשר היא מלווה בגרש מסולסל (U+2019) אך עובד עם גרש ישר (U+0027)

I’m encountering a rendering issue with inline MathJax in Discourse when the math expression is followed by a curly apostrophe (U+2019), which is commonly substituted by smart quotes in some browsers or editors.


:white_check_mark: This renders correctly:

$\mathbb{R}^2$'s basis

This uses the straight ASCII apostrophe (U+0027).

\mathbb{R}^2's basis


:cross_mark: This fails to render:

$\mathbb{R}^2$’s basis

$\mathbb{R}^2$’s basis

This uses the curly right single quote (U+2019), sometimes auto-inserted by mobile keyboards, rich text editors, or copy/paste from formatted sources.


Expected behavior:

Both versions should render the math properly. The character immediately following an inline math block shouldn’t affect MathJax parsing.

Why this matters:

  • This is hard to detect unless you’re comparing Unicode.
  • The curly apostrophe is visually indistinguishable from the straight one in most fonts.
  • A minor formatting difference like this shouldn’t silently break rendering.
  • Inconsistent behavior undermines the authoring experience for math-heavy posts.

I wouldn’t expect TeX to treat a quote and a curly quote the same way. This seems like the expected behavior, however annoying.

This seems like the source of the problem, but that’s probably just because I’m old. :wink:

לייק 1

oh so the MathJax engine, can it see what’s outside of $…$ or \begin{matrix}\$\$ \\\vdots\\\$\$ \end{matrix}

בסיס של \mathbb{R}^2

בסיס של \mathbb{R}^2

בסיס של \mathbb{R}^2

לייק 1