We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请先看《提问的智慧》,并尝试到黑客派搜寻资料解决问题。
下载的官网的demo里面有一个完整示例:https://vditor.b3log.org/demo/preview.html
也就是preview.html 文件。配置修改了数学公式的引擎,其他的没有修改:
const initRender = () => { fetch('markdown/zh_CN.md').then(response => response.text()).then(markdown => { Vditor.preview(document.getElementById('preview'), markdown, { sanitize: false, markdown: { sanitize: false, }, speech: { enable: true, }, "math": { "engine": "MathJax", "macros": { "bf": "{\\boldsymbol f}", "bu": "{\\boldsymbol u}", "bv": "{\\boldsymbol v}", "bw": "{\\boldsymbol w}" }, "inlineDigit": true }, anchor: 1, after() { if (window.innerWidth <= 768) { return } const outlineElement = document.getElementById('outline') Vditor.outlineRender(document.getElementById('preview'), outlineElement) if (outlineElement.innerText.trim() !== '') { outlineElement.style.display = 'block' initOutline() } }, }) }) }
zh_cn.md填入的内容如下:
zh_cn.md
$$ \begin{aligned} \varphi (72) &=\varphi (2^{3}\times 3^{2})\\ &=2^{3-1}(2-1)\times 3^{2-1}(3-1)\\ &=2^{2}\times 1\times 3\times 2\\ &=24 \end{aligned} $$
打开preview.html,数学公式显示一下马上就消失掉了,但是在编辑器中显示和预览都是正常的,不知道是我的操作原因吗?
最后解析出来的html,data-math是空的:
<div class="vditor-math" data-math=""><mjx-container class="MathJax CtxtMenu_Attached_0" jax="SVG" display="true" tabindex="0" ctxtmenu_counter="1"><svg xmlns="http://www.w3.org/2000/svg" width="0.002ex" height="0" role="img" focusable="false" viewBox="0 0 1 0" preserveAspectRatio="xMidYMid slice" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: 0px;"><defs></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g data-mml-node="math"></g></g></svg></mjx-container></div>
The text was updated successfully, but these errors were encountered:
3b476bf
Vanessa219
No branches or pull requests
请先看《提问的智慧》,并尝试到黑客派搜寻资料解决问题。
描述问题
下载的官网的demo里面有一个完整示例:https://vditor.b3log.org/demo/preview.html
也就是preview.html 文件。配置修改了数学公式的引擎,其他的没有修改:
zh_cn.md
填入的内容如下:打开preview.html,数学公式显示一下马上就消失掉了,但是在编辑器中显示和预览都是正常的,不知道是我的操作原因吗?
最后解析出来的html,data-math是空的:
截屏或录像
The text was updated successfully, but these errors were encountered: