- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 jqMath用于数学方程格式化程序。我不想从表达式中删除空格和换行符。我怎样才能做到这一点?我已经尝试了很多,但找不到任何解决方案。
最佳答案
来自作者...
In general, it's best to let html handle the text, and jqMath handle the math. For example, write " using $y = (x+1)/(x+2)$", or "<td>$x+y = 2$<td>(1)" inside an html table.
You have to be able to separate user input into mathematics and non-mathematics. If a user inputs "using y=x" you don't want "using" parsed as the product of 5 variables u, s, i, n, and g. Similarly, if he inputs extra spaces that you want to keep outside the mathematics, you have to capture them using regular expressions or something, and don't pass them to jqMath. If you want the spaces to be part of the mathematics, you could make the user input \table or \sp or \text or something, though most users won't know to do that. You could tell users that they need to put $ $ around their mathematics if they want it to format, and then you could search for that.
Basically, jqMath isn't smart enough to tell what's math and what isn't, without $ $ to help.
Probably 0.2.0 will be out in a couple months, or at least I'll have a version I could send you by then.
更新: 支持/text 和/html 的新版本已经发布
关于javascript - 如何在 jqMath 中的格式化表达式中保留空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7601222/
我是一名优秀的程序员,十分优秀!