markdown-it-katex
Advanced tools
Comparing version 1.0.9 to 1.1.0
11
index.js
@@ -223,3 +223,3 @@ /* Process inline math */ | ||
module.exports = function math_plugin(md) { | ||
module.exports = function math_plugin(md, options) { | ||
// Default options | ||
@@ -231,5 +231,9 @@ | ||
blockClose = '$$'; | ||
options = options || {}; | ||
// set KaTeX as the renderer for markdown-it-simplemath | ||
var katexInline = function(latex){ | ||
return katex.renderToString(latex, {"displayMode" : false}); | ||
options.displayMode = false; | ||
return katex.renderToString(latex, options); | ||
}; | ||
@@ -242,3 +246,4 @@ | ||
var katexBlock = function(latex){ | ||
return katex.renderToString(latex, {"displayMode" : true}); | ||
options.displayMode = true; | ||
return katex.renderToString(latex, options); | ||
} | ||
@@ -245,0 +250,0 @@ |
{ | ||
"name": "markdown-it-katex", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "Fast math support for markdown-it with KaTeX", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -46,2 +46,7 @@ # markdown-it-katex | ||
`KaTeX` options can be supplied with the second argument to use. | ||
```javascript | ||
md.use(mk, {"throwOnError" : false, "errorColor" : " #cc0000"}); | ||
``` | ||
## Examples | ||
@@ -48,0 +53,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14694
7
247
82