苗条的js:通过mathjax渲染mathml

问题描述

我有一个sveltejs SPA,我在其中加载一些mathml内容并通过mathjax显示它。 这是相关代码

async function hashChange() {
  await renderContent();
  console.log("content *NOT* rendered,but it should!");
  MathJax.typeset();
  console.log("content is rendered only Now");
}

onMount(() => {
  hashChange();
});

问题在于页面仅在MathJax.typeset()之后呈现,而我希望在renderContent()之后首先呈现原始mml,然后在MathJax.typeset()之后使用排版的mml进行刷新。 / p>

我尝试使用MathJax.typesetPromise(),但结果是相同的。

有什么建议吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)