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

The env align is not rendered by KaTeX #22447

Closed
cosing opened this issue Jan 14, 2023 · 2 comments · Fixed by #22453
Closed

The env align is not rendered by KaTeX #22447

cosing opened this issue Jan 14, 2023 · 2 comments · Fixed by #22453
Labels
Milestone

Comments

@cosing
Copy link

cosing commented Jan 14, 2023

Description

line 1

$$\begin{align*}
Y= &-28.482\times 10^6 Fantasy+  7.232×10^6 \times TopDirector\\
   &+ 7.846\times 10^6 Origin + 11.818×10^6 \times Sci Fi
\end{align*}$$

line 2

$$\begin{align*}
Y= &-28.482\times 10^6 Fantasy+  7.232×10^6 \times TopDirector\\
   &+ 7.846\times 10^6 Origin + 11.818×10^6 \times Sci Fi
\end{align*}
$$

line 3

Correctly presented in github or KaTeX:

line 1

$$\begin{align*} Y= &-28.482\times 10^6 Fantasy+ 7.232×10^6 \times TopDirector\\ &+ 7.846\times 10^6 Origin + 11.818×10^6 \times Sci Fi \end{align*}$$

line 2

$$\begin{align*} Y= &-28.482\times 10^6 Fantasy+ 7.232×10^6 \times TopDirector\\ &+ 7.846\times 10^6 Origin + 11.818×10^6 \times Sci Fi \end{align*} $$

line 3

but on gitea

Gitea Version

1.19.0+dev-299-g20e3ffd20

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?

use https://try.gitea.io/

Database

None

@zeripath
Copy link
Contributor

ok so there are a few problems here.

The error display has clearly been broken somewhere as there should be an error displayed with this.

Once you get that - we need to pass whether there is a display mode or not - clearly that was removed too...

@zeripath
Copy link
Contributor

zeripath commented Jan 15, 2023

OK I don't understand what could be happening to make the error display disappear - I suspect it's something to do with the cllipboard? @silverwind any ideas? -- AH THERE IS A BUG IN displayError IT SHOULD BE target.classlist.remove NOT target.remove

Now, the issue appears to be that KaTeX isn't setting its setting to display mode once it sees the $$ and so the environment doesn't work. My original PR did the parsing of the $$ etc before passing to KaTeX render which would have made this work but clearly that is not good.

It's likely that this represents a bug in KaTeX - but we can just forcibly set the displayMode.

zeripath added a commit to zeripath/gitea that referenced this issue Jan 15, 2023
In go-gitea#22447 it was noticed that display environments were not working
correctly. This was due to the setting displayMode not being set.

Further it was noticed that the error was not being displayed correctly.

This PR fixes both of these issues by forcibly setting the displayMode
setting and corrects an error in displayError.

Fix go-gitea#22447

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.18.1 milestone Jan 15, 2023
lunny added a commit that referenced this issue Jan 16, 2023
In #22447 it was noticed that display environments were not working
correctly. This was due to the setting displayMode not being set.

Further it was noticed that the error was not being displayed correctly.

This PR fixes both of these issues by forcibly setting the displayMode
setting and corrects an error in displayError.

Fix #22447

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
zeripath added a commit to zeripath/gitea that referenced this issue Jan 16, 2023
Backport go-gitea#22453

In go-gitea#22447 it was noticed that display environments were not working
correctly. This was due to the setting displayMode not being set.

Further it was noticed that the error was not being displayed correctly.

This PR fixes both of these issues by forcibly setting the displayMode
setting and corrects an error in displayError.

Fix go-gitea#22447

Signed-off-by: Andrew Thornton <art27@cantab.net>
jolheiser pushed a commit that referenced this issue Jan 16, 2023
Backport #22453

In #22447 it was noticed that display environments were not working
correctly. This was due to the setting displayMode not being set.

Further it was noticed that the error was not being displayed correctly.

This PR fixes both of these issues by forcibly setting the displayMode
setting and corrects an error in displayError.

Fix #22447

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants