diff options
author | albert-github <albert.tests@gmail.com> | 2019-10-29 16:21:50 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-10-29 16:21:50 (GMT) |
commit | c42c0ae66542e4e154c2646fc725890554208d89 (patch) | |
tree | d71bc391368a885fa34327be53f8dc40b0a714e4 | |
parent | ad9be5fb2339151f1d75a6c9aba4226e48a81ae1 (diff) | |
download | Doxygen-c42c0ae66542e4e154c2646fc725890554208d89.zip Doxygen-c42c0ae66542e4e154c2646fc725890554208d89.tar.gz Doxygen-c42c0ae66542e4e154c2646fc725890554208d89.tar.bz2 |
Length of identifying fenced code block
In case we have a problem like:
```
/** \file
* ```
* router = (new Router());
* ```
*/
```
there is no problem, but as soon as we add a space somewhere before the start or end identifier of the fenced code block we get:
```
.../aa.h:6: warning: reached end of file while inside a '```' block!
The command that should end the block seems to be missing!
```
i.e. a problem like:
```
/** \file
* ```
* router = (new Router());
* ```
*/
```
or
```
/** \file
* ```
* router = (new Router());
* ```
*/
```
The relevant length is the length identifying the fenced code block / number of back ticks, not the number of spaces in front of it (analogous number of tildes).
-rw-r--r-- | src/scanner.l | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/scanner.l b/src/scanner.l index 61b51cb..513846e 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -6630,16 +6630,18 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) BEGIN(DocCopyBlock); } <DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* { - docBlock+=substitute(yytext,"*"," "); + QCString pat = substitute(yytext,"*"," "); + docBlock+=pat; docBlockName="~~~"; - g_fencedSize=yyleng; + g_fencedSize=pat.stripWhiteSpace().length(); g_nestedComment=FALSE; BEGIN(DocCopyBlock); } <DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* { - docBlock+=substitute(yytext,"*"," "); + QCString pat = substitute(yytext,"*"," "); + docBlock+=pat; docBlockName="```"; - g_fencedSize=yyleng; + g_fencedSize=pat.stripWhiteSpace().length(); g_nestedComment=FALSE; BEGIN(DocCopyBlock); } @@ -6755,15 +6757,17 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } } <DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* { - docBlock+=substitute(yytext,"*"," "); - if (g_fencedSize==yyleng) + QCString pat = substitute(yytext,"*"," "); + docBlock+=pat; + if (g_fencedSize==pat.stripWhiteSpace().length()) { BEGIN(DocBlock); } } <DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* { - docBlock+=substitute(yytext,"*"," "); - if (g_fencedSize==yyleng) + QCString pat = substitute(yytext,"*"," "); + docBlock+=pat; + if (g_fencedSize==pat.stripWhiteSpace().length()) { BEGIN(DocBlock); } |