Skip to content

Commit

Permalink
Fix #6463 Invalid katex leads to server crash
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcrab committed Nov 16, 2018
1 parent 44db2f7 commit 834c353
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/gatsby-remark-katex/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ module.exports = ({ markdownAST }) => {
node.type = `html`
node.value = katex.renderToString(node.value, {
displayMode: false,
throwOnError: false,
})
})

visit(markdownAST, `math`, node => {
node.type = `html`
node.value = katex.renderToString(node.value, {
displayMode: true,
throwOnError: false,
})
})
}
Expand Down

0 comments on commit 834c353

Please sign in to comment.