Skip to content

Conversation

@rambip
Copy link

@rambip rambip commented Dec 14, 2025

Fixes #2805

Here is what happened before with the input hello $$x$$:

  1. The RE_DOLLAR_INLINE regex matches, but only on the internal expression ($x$). It is converted to html tags, but with the external dollars that still exist.
  2. There is a second match.. The internal content is treated as is, but tags are appended a second time.

The fix was as easy as adding an optional additional dollar in the expression.

Now, all of these should match as before:

$x$
$$x$$
$x + y$
$$x + y$$
$a^2 + b^2$
$$\frac{1}{2}$$
text $x$ text
text $$x$$ text
$x$y$z$

But for $$x$$ and text $$x$$ text, the capture group should include the dollars.

Te string " $$x$$" should now match and returns the capture group containing "$$x$$"
@gir-bot gir-bot added S: needs-review Needs to be reviewed and/or approved. C: arithmatex Related to the arithmatex extension. C: source Related to source code. labels Dec 14, 2025
@facelessuser facelessuser added the S: duplicate The issue has been previously reported. label Dec 14, 2025
@facelessuser
Copy link
Owner

Closing as a duplicate of #2807

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

Labels

C: arithmatex Related to the arithmatex extension. C: source Related to source code. S: duplicate The issue has been previously reported. S: needs-review Needs to be reviewed and/or approved.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inline $$x$$ math matches 2 times and returns nested mathjax

3 participants