Skip to content
New issue

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

使用latex插件, 加载html中latex公式,在小程序中会换行 #540

Closed
xuhang1993 opened this issue Jul 26, 2023 · 15 comments
Closed
Labels
bug Something isn't working

Comments

@xuhang1993
Copy link

image
image
let html2 =
'"

<span class="mathrc"contenteditable="false" unselectable="on">$ \sqrt 3$与 <span class="mathrc"contenteditable="false" unselectable="on">$ \sqrt 3$ 二次根式

"';

@drucker2310
Copy link

感谢作者的回答,这个问题在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)
}

@jin-yufeng jin-yufeng added the bug Something isn't working label Nov 22, 2023
@kdsemfosdk
Copy link

您好 请问一下你这是小程序端还是 uniapp?

@drucker2310
Copy link

uniapp,原生小程序没试过

@kdsemfosdk
Copy link

您那个转义符是怎么处理的呢?一个斜杠不是处理不了吗?

@drucker2310
Copy link

drucker2310 commented Dec 4, 2023 via email

@kdsemfosdk
Copy link

我是在脚本上 html: '$\textrm {e}^{+}\textrm {e}^{-}\rightarrow τ^{+}τ^{-}$', 是这样的 脚本区 应该怎么写呀?let ht = String.raw(this.html)这样吗?大佬

@drucker2310
Copy link

drucker2310 commented Dec 4, 2023 via email

@kdsemfosdk
Copy link

String.raw${this.html}吗?大佬 可以发个例子吗? 膜拜

@drucker2310
Copy link

drucker2310 commented Dec 4, 2023 via email

@kdsemfosdk
Copy link

html:"$\textrm {e}^{+}\textrm {e}^{-}\rightarrow τ^{+}τ^{-}$", this.html2=String.rawthis.html 这样不行呀 大佬

@drucker2310
Copy link

drucker2310 commented Dec 4, 2023 via email

@kdsemfosdk
Copy link

里面放原始模板字符串可以 我这边场景是需要变量 一放变量就不行了

@drucker2310
Copy link

drucker2310 commented Dec 5, 2023 via email

@typing233
Copy link

那如果我 想换行,用什么,/n无效

@drucker2310
Copy link

drucker2310 commented Mar 30, 2024

那如果我 想换行,用什么,/n无效

用 \, 两个斜杠

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants