mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
internal/warpc: Enable KaTeX mhchem extension
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
5dd0ba00f7
commit
503dcf6252
@@ -9,6 +9,6 @@
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"devDependencies": {
|
||||
"katex": "^0.16.11"
|
||||
"katex": "^0.16.21"
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
|
||||
import { readInput, writeOutput } from './common';
|
||||
import katex from 'katex';
|
||||
import 'katex/contrib/mhchem/mhchem.js';
|
||||
|
||||
const render = function (input) {
|
||||
const data = input.data;
|
||||
|
@@ -77,6 +77,13 @@ func TestKatex(t *testing.T) {
|
||||
c.Assert(result.GetID(), qt.Equals, id)
|
||||
})
|
||||
|
||||
c.Run("Chemistry", func(c *qt.C) {
|
||||
id := uint32(32)
|
||||
result, err := runExpression(c, id, "C_p[\\ce{H2O(l)}] = \\pu{75.3 J // mol K}")
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(result.GetID(), qt.Equals, id)
|
||||
})
|
||||
|
||||
c.Run("Invalid expression", func(c *qt.C) {
|
||||
id := uint32(32)
|
||||
result, err := runExpression(c, id, "c & \\foo\\")
|
||||
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user