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

mdbook build hangs forever if \$ is in a formula #61

Closed
llllvvuu opened this issue Jan 25, 2023 · 2 comments · Fixed by #62
Closed

mdbook build hangs forever if \$ is in a formula #61

llllvvuu opened this issue Jan 25, 2023 · 2 comments · Fixed by #62
Labels
bug Something isn't working

Comments

@llllvvuu
Copy link

llllvvuu commented Jan 25, 2023

Reproduce:

We randomly assign: $r \xleftarrow{\$} G $.
We randomly assign: $r \xleftarrow{\\$} G $.

Expected:
We randomly assign: $r \xleftarrow{\$} G $

Actual:
Neither expression works. The \\$ produces a new line followed by ending the expression. The \$ causes the preprocessor to hang forever.

I believe the issue stems from https://github.com/lzanini/mdbook-katex/blob/master/src/lib.rs#L456 :

self.index += self.string[self.index..].find(&delim.right).ok_or(())?;

I'll try to fix...

@SichangHe SichangHe added the bug Something isn't working label Jan 25, 2023
@SichangHe
Copy link
Collaborator

The first case should work after I fix it.
The second case is already working as intended. The \\ indicates that the following $ should not be escaped and should be seen as the right delimiter for this inline math block.
Let me know if you have different opinions.

@SichangHe
Copy link
Collaborator

Thank you, @llllvvuu, for catching what I messed up! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants