Skip to content

Commit

Permalink
fix #19
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Dec 10, 2019
1 parent d3d190e commit 6b8de93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vditor",
"version": "1.10.8",
"version": "1.10.9",
"description": "A markdown editor written in TypeScript",
"author": " Vanessa <v@b3log.org> (http://vanessa.b3log.org)",
"homepage": "https://hacpai.com/tag/vditor",
Expand Down
10 changes: 4 additions & 6 deletions src/ts/markdown/mathRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import {addScript} from "../util/addScript";
import {addStyle} from "../util/addStyle";
import {code160to32} from "../util/code160to32";

declare const renderMathInElement: {
default(element: Element, option: {
delimiters: Array<{ left: string, right: string, display: boolean }>;
}): void;
};
declare const renderMathInElement: (element: Element, option: {
delimiters: Array<{ left: string, right: string, display: boolean }>;
}) => void;

export const mathRender = (element: HTMLElement, cdn: string = "..") => {
const text = code160to32(element.innerText);
Expand All @@ -17,7 +15,7 @@ export const mathRender = (element: HTMLElement, cdn: string = "..") => {

addStyle(`${cdn}/dist/js/katex/katex.min.css`, "vditorKatexStyle");

renderMathInElement.default(element, {
renderMathInElement(element, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "\\(", right: "\\)", display: false},
Expand Down

0 comments on commit 6b8de93

Please sign in to comment.