mirror of
https://github.com/James-Yu/LaTeX-Workshop.git
synced 2024-10-04 15:17:59 +03:00
add comments
This commit is contained in:
parent
28da9f287e
commit
794b93625d
@ -27,6 +27,10 @@ const svgToDataUrl = function (xml) {
|
||||
return b64Start + svg64;
|
||||
}
|
||||
|
||||
// We cannot know actual colors for each theme in extension process
|
||||
// because VSCode API does not allow such operations.
|
||||
// c.f., https://github.com/Microsoft/vscode/issues/32813
|
||||
// But we can know the colors in WebView process through CSS variables.
|
||||
const pickColor = function (prop) {
|
||||
m = prop.match(/rgb\((\d+), (\d+), (\d+)\)/)
|
||||
if (m) {
|
||||
@ -85,6 +89,8 @@ const setVSCodeForegroundColor = function(tex) {
|
||||
const rgb = getVSCodeEditorForegound();
|
||||
const color = '\\color[RGB]{' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + '}';
|
||||
var ret = tex.replace(/^(\$|\\\(|\\begin{.*?}({.*?})*)/, '$1' + color);
|
||||
// insert \color{ } after each & and \\
|
||||
// while skipping CD env
|
||||
ret = ret.replace(/(\\begin{CD}[\s\S]*?\\end{CD}|((?:\\[^\\]|[^&\\])*&+|\\\\))/g, '$1' + color);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user