Update packages and linting - #1542
Conversation
dpvc
left a comment
There was a problem hiding this comment.
One issue with an incorrect comment, but otherwise ok.
| GetTemplate(parser: TexParser, cmd: string, cs: string): number | string[] { | ||
| // @test Def Double Let, Def ReDef, Def Let | ||
| let c = parser.GetNext(); | ||
| parser.GetNext(); // Remove initial '{' from the string |
There was a problem hiding this comment.
I think this is removing spaces, not {. After #1539, it will also remove comments.
There was a problem hiding this comment.
GetNext removes spaces and gets the next non-whitespace characters. But then we ignore that and then c to the next character. So does that not mean that we are effectively ignore the initial characters, which in the tests was always { ?
There was a problem hiding this comment.
No, GetNext() does return the next character, but doesn't move past it. And the next character isn't a { in the case where you have a template, like \def\x#1{...} or \def\x#1,#2\end{...}.
MathJax-src/ts/input/tex/TexParser.ts
Lines 298 to 303 in fb98717
typescriptno-useless-assignment. These generally make things clearer. The only exceptions are inWrappers/mo.tsandWrappers/mmultiscripts.tswhere it makes things slightly uglier.