internal/warpc: Enable KaTeX mhchem extension
This commit is contained in:
parent
5dd0ba00f7
commit
503dcf6252
6 changed files with 24 additions and 16 deletions
|
@ -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.
Loading…
Add table
Reference in a new issue