Skip to content

Commit

Permalink
Merge pull request #11 from haruleekim/patch-1
Browse files Browse the repository at this point in the history
fix: Wypst rendering on iOS Obsidian
  • Loading branch information
0xpapercut authored May 12, 2024
2 parents a2aafdc + 6197874 commit 22f50cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ export default class Wypst extends Plugin {

await loadMathJax();

if (!global.MathJax) {
if (!globalThis.MathJax) {
throw new Error("MathJax failed to load.");
}

await wypst.init(wasm);

const parser = new DOMParser();
this._tex2chtml = global.MathJax.tex2chtml;
this._tex2chtml = globalThis.MathJax.tex2chtml;

global.MathJax.tex2chtml = (e, r) => {
globalThis.MathJax.tex2chtml = (e, r) => {
if (!hasLatexCommand(e)) {
const renderSettings = {
displayMode: r.display,
Expand Down Expand Up @@ -65,7 +65,7 @@ export default class Wypst extends Plugin {
}

onunload() {
global.MathJax.tex2chtml = this._tex2chtml;
globalThis.MathJax.tex2chtml = this._tex2chtml;
this.app.workspace.getActiveViewOfType(MarkdownView)?.previewMode.rerender(true);
}
}
Expand Down

0 comments on commit 22f50cc

Please sign in to comment.