-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Properly render KaTeX formulas by replacing katex shortcode by katexinline and katexblock #634
Conversation
✅ Deploy Preview for hugo-congo ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks for the PR, I wonder if there's a better way we can implement this so that it keeps the |
I agree, it's better to avoid a breaking change. It would make the shortcode even longer tough, which is not ideal especially for inline blocks. We can also make inline the default mode, so that it is not necessary to specify it in lines. We could also merge this shortcode with my proposal for katex macros support (see #637) with a On the other hand, detecting in the shortcode means asking the user to specify whether it's a block or inline with So my new proposal is:
What do you think? |
I revisited my macro implementation to follow the proposal above. Sadly this is still a broken change since these blocks require an I'm not sure how you want to proceed with this. |
4d199d7
to
90c9c2b
Compare
Add block and inline parameter to katex shortcode to encapsulate katex notation
90c9c2b
to
9889294
Compare
in the meantime I updated the PR to mirror the proposal above and speed up the process. |
This pull request has been automatically marked as stale because it has not had any recent activity. |
Relevant issue: #633
katex
shortcode includes KaTeX in the page but does not protect KaTeX formulas from being parsed by Hugo's markdown parser.This PR fixes the problem by replacing it by two encasing shortcodes
katexblock
andkatexinline
.The partial vendors checks if any of these two shortcodes is present in the page and if so, it includes the KaTeX lib.
katex
shortcode is removed from the shortcodes.The two new shortcodes are used as follows:
The names are a bit long (especially for inline), but more explicit is often better than shorter. I'm open to suggestions.
Note: