diff --git a/CHANGELOG.md b/CHANGELOG.md index 8007725..cbb09eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ ## **2.1.24** released on 28th February 2018 -- **New:** LaTeX magic comments (`!TEX`) removed from spelling. +- **New:** LaTeX magic comments (`!TEX`) removed from spelling ([#120](https://github.com/bartosz-antosik/vscode-spellright/issues/120)). - **New:** Added spelling parser settings for LISP (comments & strings) source code files. +- **Change:** LaTeX commands with nested curly braces improperly removed from spelling ([#120](https://github.com/bartosz-antosik/vscode-spellright/issues/120)). ## **2.1.22** released on 26th February 2018 diff --git a/lib/parsers/latex.js b/lib/parsers/latex.js index 35fa40e..96e33a1 100644 --- a/lib/parsers/latex.js +++ b/lib/parsers/latex.js @@ -43,7 +43,7 @@ class LaTeX extends Parser.default { } // Remove commands - var re = /\\\w+\*?(\[[\s\S]*?\])*((\{|\()[\s\S]*?(\}|\)))*(\[[\s\S]*?\])*/g; + var re = /\\\w+\*?(\[[\s\S]*?\])*(\{(?:\{[^\}]*\}|[^\{\}])*\})/g; while (match = re.exec(text)) { //var replace = ' '.repeat(match[0].length); var replace = match[0].replace(/(?:[^\r\n]|\r(?!\n))/g, ' ');