-
Notifications
You must be signed in to change notification settings - Fork 359
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
Allow the kramdown math engine to be overridden #545
base: master
Are you sure you want to change the base?
Conversation
This will allow the use of the nil math engine in kramdown, which provides a saner default for templates that don't want mathjax but want a safe fallback for when javascript is disabled.
+1. Please allow this the math engine to be disabled completely. I use KaTeX, which is lighter and substantially preferable than MathJax for my site. |
Hey! I'd be happy to accept this PR with the following condition: we override any non-nil math engine to |
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.
Requires code which overwrites non-nil values, e.g.
config["kramdown"]["math_engine"] = DEFAULTS["kramdown"]["math_engine"] unless config["kramdown"]["math_engine"].nil?
The docs seem to indicate that the KaTeX engine is intended for untrusted user input. Of course, the PR as it stands now would also allow the Perhaps a better way would be to list permitted options, with the first as a default? That would be a more flexible solution moving forward, and keep the current declarative style. |
@stevenkaras, any progress on this? I also prefer allowing |
I don't think we can do any security auditing of new gems, so I'd like to simply allow you to unset the math engine, i.e. allowed values are Allowing the |
That sounds reasonable. I don't have access to this PR, so opened a new one off of master with your requested changes. |
This will allow the use of the nil math engine in kramdown, which
provides a saner default for templates that don't want mathjax but want
a safe fallback for when javascript is disabled.
From the history of this repo, the math engine used to be changeable up until 2 years ago when kramdown became the primary/only markdown engine. I have not checked if the version of kramdown used back then even had multiple math engines.