Skip to content

Commit

Permalink
fix: fixed arnog#1981
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed May 23, 2023
1 parent 227ac24 commit 56cec2b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/editor-mathfield/keyboard-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,12 @@ function insertMathModeChar(
if (mathfield.adoptStyle !== 'none') {
// If adding an alphabetic character, and the neighboring atom is an
// alphanumeric character, use the same variant/variantStyle (\mathit, \mathrm...)
const sibling = mathfield.adoptStyle === 'left' ? atom : atom.rightSibling;
const sibling =
mathfield.adoptStyle === 'left'
? atom
: atom.parent
? atom.rightSibling
: null;
if (
sibling?.type === 'mord' &&
/[a-zA-Z0-9]/.test(sibling.value) &&
Expand Down

0 comments on commit 56cec2b

Please sign in to comment.