Closed xuhang1993 closed 7 months ago
感谢作者的回答,这个问题在mp-html/atex文件夹下的index.js文件中将下面代码的 name 的字符串由‘div’改为 span if ((index + 1) % 2 === 0) { return { name: 'div', attrs: {}, f: 'display:inline-block', children: parse.default(str) }
您好 请问一下你这是小程序端还是 uniapp?
uniapp,原生小程序没试过
您那个转义符是怎么处理的呢?一个斜杠不是处理不了吗?
如果不在脚本区写,而在组件上写就不需要转换。在脚本区的话,你可以用string.raw转化就可以了
---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2023年12月04日 18:18 | | 收件人 | jin-yufeng/mp-html @.> | | 抄送人 | drucker2310 @.>, Comment @.> | | 主题 | Re: [jin-yufeng/mp-html] 使用latex插件, 加载html中latex公式,在小程序中会换行 (Issue #540) |
您那个转义符是怎么处理的呢?一个斜杠不是处理不了吗?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
我是在脚本上 html: '$\textrm {e}^{+}\textrm {e}^{-}\rightarrow τ^{+}τ^{-}$', 是这样的 脚本区 应该怎么写呀?let ht = String.raw(this.html)这样吗?大佬
脚本区,把那个括号换成两个模板字符串的引号
---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2023年12月04日 18:31 | | 收件人 | jin-yufeng/mp-html @.> | | 抄送人 | drucker2310 @.>, Comment @.> | | 主题 | Re: [jin-yufeng/mp-html] 使用latex插件, 加载html中latex公式,在小程序中会换行 (Issue #540) |
我是在脚本上 html: '$\textrm {e}^{+}\textrm {e}^{-}\rightarrow τ^{+}τ^{-}$', 是这样的 脚本区 应该怎么写呀?let ht = String.raw(this.html)这样吗?大佬
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
String.raw${this.html}
吗?大佬 可以发个例子吗? 膜拜
Let html = String.raw latex 代码
---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2023年12月04日 18:59 | | 收件人 | jin-yufeng/mp-html @.> | | 抄送人 | drucker2310 @.>, Comment @.> | | 主题 | Re: [jin-yufeng/mp-html] 使用latex插件, 加载html中latex公式,在小程序中会换行 (Issue #540) |
String.raw${this.html}吗?大佬 可以发个例子吗? 膜拜
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
html:"$\textrm {e}^{+}\textrm {e}^{-}\rightarrow τ^{+}τ^{-}$", this.html2=String.rawthis.html
这样不行呀 大佬
你为什么不按我发的来
---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2023年12月04日 20:35 | | 收件人 | jin-yufeng/mp-html @.> | | 抄送人 | drucker2310 @.>, Comment @.> | | 主题 | Re: [jin-yufeng/mp-html] 使用latex插件, 加载html中latex公式,在小程序中会换行 (Issue #540) |
html:"$\textrm {e}^{+}\textrm {e}^{-}\rightarrow τ^{+}τ^{-}$", this.html2=String.rawthis.html 这样不行呀 大佬
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
里面放原始模板字符串可以 我这边场景是需要变量 一放变量就不行了
原始那就不是模板字符串,我不是已经给你放到变量里了吗,不然html 是什么,不是变量吗
---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2023年12月05日 09:13 | | 收件人 | jin-yufeng/mp-html @.> | | 抄送人 | drucker2310 @.>, Comment @.> | | 主题 | Re: [jin-yufeng/mp-html] 使用latex插件, 加载html中latex公式,在小程序中会换行 (Issue #540) |
里面放原始模板字符串可以 我这边场景是需要变量 一放变量就不行了
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
那如果我 想换行,用什么,/n无效
那如果我 想换行,用什么,/n无效
用 \, 两个斜杠
let html2 = '"
$ \sqrt 3$与 $ \sqrt 3$ 二次根式
"';