Skip to content

Commit 320dad7

Browse files
committed
fix nested subscript in math
1 parent c78f65d commit 320dad7

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

bun.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@tauri-apps/plugin-updater": "~2.7.1",
3333
"i18next": "^25.6.0",
3434
"lexical": "^0.38.2",
35-
"mathlive": "^0.106.0",
35+
"mathlive": "^0.108.2",
3636
"mousetrap": "^1.6.5",
3737
"mousetrap-global-bind": "^1.1.0",
3838
"mousetrap-record": "^1.0.1",

src/components/plugins/MathPlugin.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,18 @@ export const MathEditor = ({
102102
useEffect(() => {
103103
const mf = mathfieldRef.current
104104
if (mf) {
105-
mf.mathVirtualKeyboardPolicy = "manual"
106-
mf.keybindings = mf.keybindings.filter(
107-
(keybinding) =>
108-
!(
109-
Array.isArray(keybinding.command) &&
110-
keybinding.command[0] === "insert"
111-
),
112-
)
105+
console.log(mf.keybindings)
106+
mf.keybindings = [
107+
...mf.keybindings.filter(
108+
(keybinding) =>
109+
!(
110+
Array.isArray(keybinding.command) &&
111+
keybinding.command[0] === "insert"
112+
),
113+
),
114+
// TODO: why is this needed?
115+
{ key: "_", command: ["insert", "_{#0}"] },
116+
]
113117

114118
if (mf.isConnected && !mf.isRegistered) {
115119
mf.isRegistered = true

0 commit comments

Comments
 (0)