From a7d403098bddff8c0feca6c562ba05f03b5ab2ae Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 23 Nov 2021 15:22:02 +0100 Subject: [PATCH] issue #7807 Incorrect handling of triple backticks with specifying language. Regression when having e.g. ~~~ `
`
~~~
we got problem (block not properly recognized.
Previous fix was to rigorous, should have explicit language possibilities.
---
 src/scanner.l | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/scanner.l b/src/scanner.l
index 9eb785db0ca..683639e7369 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -6604,7 +6604,9 @@ NONLopt [^\n]*
                                           yyextra->nestedComment=FALSE;
                                           BEGIN(DocCopyBlock);
                                         }
-^({B}*"*"+)?{B}{0,3}"```"[`]*                {
+^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
+^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
+^({B}*"*"+)?{B}{0,3}"```"[`]* {
                                           QCString pat = substitute(yytext,"*"," ");
                                           yyextra->docBlock << pat;
                                           yyextra->docBlockName="```";
@@ -6625,7 +6627,7 @@ NONLopt [^\n]*
                                             REJECT;
                                           }
                                         }
-[^@*~`\/\\\n]+                { // any character that isn't special
+[^@*~\/\\\n]+                 { // any character that isn't special
                                           yyextra->docBlock << yytext;
                                         }
 \n                            { // newline