gatsby-remark-katex
Advanced tools
Comparing version 1.1.0-alpha.22c8a6f1 to 1.1.0-alpha.5db7a275
18
index.js
"use strict"; | ||
const visit = require(`unist-util-visit`); | ||
const katex = require(`katex`); | ||
const remarkMath = require(`remark-math`); | ||
var visit = require(`unist-util-visit`); | ||
var katex = require(`katex`); | ||
var remarkMath = require(`remark-math`); | ||
module.exports = ({ markdownAST }) => { | ||
visit(markdownAST, `inlineMath`, node => { | ||
module.exports = function (_ref) { | ||
var markdownAST = _ref.markdownAST; | ||
visit(markdownAST, `inlineMath`, function (node) { | ||
node.type = `html`; | ||
@@ -15,3 +17,3 @@ node.value = katex.renderToString(node.value, { | ||
visit(markdownAST, `math`, node => { | ||
visit(markdownAST, `math`, function (node) { | ||
node.type = `html`; | ||
@@ -24,2 +26,4 @@ node.value = katex.renderToString(node.value, { | ||
module.exports.setParserPlugins = () => [remarkMath]; | ||
module.exports.setParserPlugins = function () { | ||
return [remarkMath]; | ||
}; |
{ | ||
"name": "gatsby-remark-katex", | ||
"description": "Transform math nodes to html markup", | ||
"version": "1.1.0-alpha.22c8a6f1", | ||
"version": "1.1.0-alpha.5db7a275", | ||
"author": "Jeffrey Xiao <jeffrey.xiao1998@gmail.com>", | ||
"dependencies": { | ||
"babel-runtime": "6.26.0", | ||
"babel-runtime": "^6.26.0", | ||
"katex": "^0.7.1", | ||
@@ -22,4 +22,8 @@ "remark-math": "^0.2.4", | ||
"build": "babel src --out-dir . --ignore __tests__", | ||
"watch": "babel -w src --out-dir . --ignore __tests__" | ||
"watch": "babel -w src --out-dir . --ignore __tests__", | ||
"prepublish": "cross-env NODE_ENV=production npm run build" | ||
}, | ||
"devDependencies": { | ||
"cross-env": "^5.0.5" | ||
} | ||
} |
10159
63
1
Updatedbabel-runtime@^6.26.0