sailfork / t3code-github / patches/ mdast-util-math@3.0.0.patch
diff --git a/lib/index.js b/lib/index.js
--- a/lib/index.js
+++ b/lib/index.js
@@ -144,6 +144,10 @@
const data = this.resume()
const node = this.stack[this.stack.length - 1]
assert(node.type === 'inlineMath')
+ const source = this.sliceSerialize(token)
+ if (source.startsWith('$') || source.startsWith('\\[')) {
+ node.data.hProperties.className = ['language-math', 'math-display']
+ }
this.exit(token)
node.value = data
const children = /** @type {Array<HastElementContent>} */ (