Skip to content

$ in math \text{} doesn't render #28070

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

Closed
nschloe opened this issue Nov 15, 2023 · 8 comments
Closed

$ in math \text{} doesn't render #28070

nschloe opened this issue Nov 15, 2023 · 8 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@nschloe
Copy link

nschloe commented Nov 15, 2023

Description

MWE:

$\text{$b$}$

Gitea output:

screenshot_2023-11-15-100633

Native KaTeX output:

screenshot_2023-11-15-100651

This is not an issue with bracket delimiters

\(\text{$b$}\)
\[
\text{$b$}
\]
```math
\text{$b$}
```

screenshot_2023-11-17-081825

(Except for the fact math code blocks don't center the math, cf. #27602.)

Gitea Version

1.22.0+dev-326-gf65977df3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

https://try.gitea.io/

Database

None

@yp05327
Copy link
Contributor

yp05327 commented Nov 16, 2023

Reproduce:
image
image

image
image
Then I removed all $, I got:
image

In GitHub:

$$\$\text{\$b\$}\$$$

↓ code
image
right click:
image
It seems that GitHub is using MathJax

@nschloe
Copy link
Author

nschloe commented Nov 17, 2023

@yp05327 Your accidentally added too many $ in the display-math example; it works fine there.

@yp05327
Copy link
Contributor

yp05327 commented Nov 20, 2023

Ah, I understanded this issue.

Do you mean that

$\text{$b$}$

and
image

should have same result?

@nschloe
Copy link
Author

nschloe commented Nov 20, 2023

Almost.

$\text{$b$}$

and

\(\text{$b$}\)

should give the same result.

(When it comes to backtick math, ```math, I'm arguing in another issue report that it should be display math, not inline math. This is a whole different issue though.)

@wxiaoguang
Copy link
Contributor

Markdown is not a strict language, we we have no strict parser for it, it's impossible to guess which $ is the real stop marker at the moment. GitHub doesn't render it either.

$\text{$b$}$

So, using non-ambiguity quotes like\(\text{$b$}\) is the best approach.

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Dec 6, 2024
@wxiaoguang
Copy link
Contributor

OK, managed to make it work by some small changes, will propose some new PRs to improve.

image

@wxiaoguang
Copy link
Contributor

1.23 nightly is ready and I think it should have been fixed, feel free to take a try

image

@nschloe
Copy link
Author

nschloe commented Dec 10, 2024

Confirmed fixed.

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Mar 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

3 participants