Skip to content

Commit

Permalink
feat: add nodeClassNameList Option
Browse files Browse the repository at this point in the history
  • Loading branch information
Dup4 committed Jun 2, 2022
1 parent 26f0174 commit 3027b6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/mathjax-render/src/browser/Tex2SVG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const mathDocument = mathjax.document(document, {
mathDocument.updateDocument();

export interface Options {
nodeClassName?: string;
nodeClassNameList?: string[];
}

export function Tex2SVG(math: string, display: boolean, options?: Options) {
Expand All @@ -30,8 +30,8 @@ export function Tex2SVG(math: string, display: boolean, options?: Options) {
display,
});

if (options?.nodeClassName) {
wrapper.classList.replace("MathJax", options.nodeClassName);
if (options?.nodeClassNameList) {
wrapper.classList.add(...options.nodeClassNameList);
}

const title = document.createElement("title");
Expand Down

0 comments on commit 3027b6d

Please sign in to comment.