Skip to content

Commit

Permalink
Merge pull request #3888 from udecode/feat/math
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfeng33 authored Dec 20, 2024
2 parents fbfe5db + 174f360 commit 833e373
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-berries-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-math': patch
---

Add `getEquationHtml`
11 changes: 11 additions & 0 deletions packages/math/src/lib/utils/getEquationHtml.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import katex, { type KatexOptions } from 'katex';

import type { TEquationElement } from '../../lib';

export const getEquationHtml = ({
element,
options,
}: {
element: TEquationElement;
options?: KatexOptions;
}) => katex.renderToString(element.texExpression, options);

0 comments on commit 833e373

Please sign in to comment.