-
Notifications
You must be signed in to change notification settings - Fork 42
Attempt to fix markdown KaTeX rendering issue #290
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
Attempt to fix markdown KaTeX rendering issue #290
Conversation
**Disclaimer**: I only "tested" this with the math shown in the description of `/jobs/b6187b88-a423-4ab4-94d2-e7eba2b0bd25`.
This PR implements KaTeX support across various sections—specifically, for Jobs and Challenges, as demonstrated by the following links: Currently, KaTeX rendering does not function as expected in Quizzes, which can be seen here. If you could update to include quizzes with multiline support as well, we can merge :) |
Hi, Before: see here I'm not sure if I understood what you meant with "multiline support" correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be working quite well :) Code is good as well. @Defelo please review and merge if okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the challenges page KaTeX rendering still seems to be missing:
Preview deployed to https://f9326442.academy-preview.pages.dev (total size: 15M) |
Yeah, I missed that one... Should work now, see here. |
Description
Disclaimer: I only tested this with the math shown in the description of
/jobs/b6187b88-a423-4ab4-94d2-e7eba2b0bd25
. It might be that this doesn't work on other sites.Markdown KaTeX (i.e. math) didn't render correctly for the above-mentioned job.
Relevant input:
Relevant output:

There were a few problems:
rac
, which caused the shown error.tex
input before passing it tokatex.renderToString
.markdown.ts
file only checked for display math which is surrounded by$$
, but not for inline math which is surrounded by$
.{ displayMode: isDisplayMath }
tokatex.renderToString
.markdown.ts
file didn't contain thekatex.min.css
. This can cause KaTeX to render two outputs (see this discussion).Now, the output to the above input looks like:

Type of change
Related to Bootstrap-Academy/Bootstrap-Academy#76
My Bootstrap Academy username: jonathan123456789