Skip to content

Commit

Permalink
Merge pull request #3396 from serlo/3394-consequently-use-static-math…
Browse files Browse the repository at this point in the history
…-in-editor

fix(math): always use static math
  • Loading branch information
Entkenntnis authored Feb 15, 2024
2 parents da09d10 + e0c4648 commit 6fa126a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
8 changes: 2 additions & 6 deletions packages/editor/src/plugins/text/components/math-element.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ import {
useSelected,
} from 'slate-react'

/* eslint-disable import/no-unassigned-import */
import 'katex/contrib/mhchem'

import { MathFormula } from './math-formula'
import { StaticMath } from '../static-components/static-math'
import type {
MathElement as MathElementType,
Paragraph,
Expand Down Expand Up @@ -53,11 +50,10 @@ export function MathElement({
if (!shouldShowMathEditor) {
return (
<>
<KaTeXStyles />
{/* Slate void elements need to set attributes and contentEditable={false}
See: https://docs.slatejs.org/api/nodes/element#rendering-void-elements */}
<span {...attributes} contentEditable={false}>
<MathFormula element={element} />
<StaticMath src={element.src} inline={element.inline} type="math" />
{children}
</span>
</>
Expand Down
25 changes: 0 additions & 25 deletions packages/editor/src/plugins/text/components/math-formula.tsx

This file was deleted.

0 comments on commit 6fa126a

Please sign in to comment.