Allow the kramdown math engine to be overridden#545
Allow the kramdown math engine to be overridden#545stevenkaras wants to merge 1 commit intogithub:masterfrom
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 |
parkr
left a comment
There was a problem hiding this comment.
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.