From 94556355036eee38b0403f059a8674408e7e4ea8 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 25 Apr 2020 12:54:07 +0200 Subject: Undefined control sequence for formula using MathJax (#7712) When having a code comment like: ``` @code sub postprocess { s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g; s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g; } @endcode ``` and using MathJax the `/(` is seen as a the beginning of a formula, but should be seen as text and can now lead to "Undefined control sequence". (The problem comes originally from code as generated by the doxygen-perl-filter for converting perl code in something doxygen does understand). This problem is similar to the problems solved in pull request #7697, but not handled here. This pull request will see `\(` (and its counter part `\)` as complete entities and replace them in a similar way as done in #7697 (but now in an earlier stage but the `‍` will be properly filtered in the different output formats. --- src/code.l | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/code.l b/src/code.l index a01f0f8..1c60fcf 100644 --- a/src/code.l +++ b/src/code.l @@ -1090,6 +1090,9 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" yyextra->parmType = yyextra->name; BEGIN(FuncCall); } +"\\)"|"\\(" { + yyextra->code->codify(yytext); + } [\\|\)\+\-\/\%\~\!] { yyextra->code->codify(yytext); yyextra->name.resize(0);yyextra->type.resize(0); -- cgit v0.12