有没有办法在visualstudio中配置任何拼写检查插件来忽略markdown中$$分隔符之间的数学片段?
$$
Δx = frac{1}{2} (v_i + v_f) Δt ignore any mi∑takes here
$$
configure to notice this mi∑take
$$
Δx = frac{1}{2} (v_i + v_f) Δt
$$
具有以下设置的Spellright插件:
"spellright.ignoreRegExpsByClass": {
"markdown": [
"/\\\\\([^]*?\\\\\)/gm" ,
"/\\\\\[[^]*?\\\\\]/gm" ,
"/\$\$[^]*?\$\$/gm" ],
]
}
我是如何到达那里的:
- 我从git页面移到了git实验室页面,所以我使用了以下语法
( <mathjax> )
因为我使用jekyll从降价中生成页面,所以我不得不逃脱的后斜杠
\( <mathjax> \)
然后我使用了拼写正确插件regex忽略设置。为了忽略分隔符之间的任何内容,我必须对正则表达式中的反斜杠进行转义,并且因为正则表达式是作为字符串输入的,所以我必须对字符串中的反斜线进行转义,所以我最终得到:
"spellright.ignoreRegExpsByClass": {
"markdown": [
"/\\\\\(.*\\\\\)/gm" ,
"/\\\\\[.*\\\\\]/gm" ]
}
但是。与换行符不匹配,所以我将其更改为:
"spellright.ignoreRegExpsByClass": {
"markdown": [
"/\\\\\([^]*?\\\\\)/gm" ,
"/\\\\\[[^]*?\\\\\]/gm" ,
]
}
并添加了一个模式以匹配原始$$…$$问题
"spellright.ignoreRegExpsByClass": {
"markdown": [
"/\\\\\([^]*?\\\\\)/gm" ,
"/\\\\\[[^]*?\\\\\]/gm" ,
"/\$\$[^]*?\$\$/gm" ],
]
}