mirror of
https://github.com/James-Yu/LaTeX-Workshop.git
synced 2024-10-04 15:17:59 +03:00
remove label. skip CD env
This commit is contained in:
parent
c34cd42b87
commit
3f830124a1
@ -82,9 +82,10 @@ const setMathInDiv = function (divid, tmpid) {
|
||||
|
||||
const setVSCodeForegroundColor = function(tex) {
|
||||
const rgb = getVSCodeEditorForegound();
|
||||
const color = '\\color[RGB]{' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + '}'
|
||||
const ret = tex.replace(/^(\$|\\\(|\\begin{.*?})/, '$1' + color);
|
||||
return ret.replace(/(&|\\\\)/g, '$1' + color);
|
||||
const color = '\\color[RGB]{' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + '}';
|
||||
var ret = tex.replace(/^(\$|\\\(|\\begin{.*?}({.*?})*)/, '$1' + color);
|
||||
ret = ret.replace(/(\\begin{CD}[\s\S]*?\\end{CD}|((?:\\[^\\]|[^&\\])*&+|\\\\))/g, '$1' + color);
|
||||
return ret;
|
||||
}
|
||||
|
||||
window.addEventListener('message', event => {
|
||||
|
@ -67,9 +67,10 @@ export class HoverProvider implements vscode.HoverProvider {
|
||||
}
|
||||
|
||||
private mathjaxify_tex(tex: string, envname: string) : string {
|
||||
const ret = tex.replace(/^\s*%.*?\r?\n/mg, '')
|
||||
let ret = tex.replace(/^\s*%.*?\r?\n/mg, '')
|
||||
ret = ret.replace(/\\label\{.*?\}/g, '')
|
||||
if (envname.match(/^(aligned|alignedat|array|Bmatrix|bmatrix|cases|CD|gathered|matrix|pmatrix|smallmatrix|split|subarray|Vmatrix|vmatrix)$/)) {
|
||||
return '\\begin{equation}' + ret + '\\end{equation}'
|
||||
ret = '\\begin{equation}' + ret + '\\end{equation}'
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user