diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-09 09:45:11 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-09 09:45:11 (GMT) |
commit | 3cbb8b8b56cb56f9cca84740baa065cb07997f90 (patch) | |
tree | e651b24cba04b9260f531125a43331f2ebf3ed9a | |
parent | 137328681e7dcbd07a5ec0e4b068aea96ec41b4a (diff) | |
download | Doxygen-3cbb8b8b56cb56f9cca84740baa065cb07997f90.zip Doxygen-3cbb8b8b56cb56f9cca84740baa065cb07997f90.tar.gz Doxygen-3cbb8b8b56cb56f9cca84740baa065cb07997f90.tar.bz2 |
issue #7570 Comments replaced by block comments inside Markdown code block
-rw-r--r-- | src/commentcnv.l | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l index ba2e5ec..5198a98 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -349,6 +349,17 @@ MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z yyextra->blockName=&yytext[1]; BEGIN(VerbatimCode); } +<CComment,ReadLine>("```"[`]*|"~~~"[~]*) { /* start of markdown code block */ + if (!Config_getBool(MARKDOWN_SUPPORT)) + { + REJECT; + } + copyToOutput(yyscanner,yytext,(int)yyleng); + yyextra->lastCommentContext = YY_START; + yyextra->javaBlock=0; + yyextra->blockName=QCString(yytext).left(3); + BEGIN(VerbatimCode); + } <CComment,ReadLine>[\\@]("dot"|"code"|"msc"|"startuml")/[^a-z_A-Z0-9] { /* start of a verbatim block */ copyToOutput(yyscanner,yytext,(int)yyleng); yyextra->lastCommentContext = YY_START; @@ -427,6 +438,13 @@ MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z } } } +<VerbatimCode>("```"[`]*|"~~~"[~]*) { /* end of markdown code block */ + copyToOutput(yyscanner,yytext,(int)yyleng); + if (yytext[0]==yyextra->blockName[0]) + { + BEGIN(yyextra->lastCommentContext); + } + } <VerbatimCode>[\\@]("enddot"|"endcode"|"endmsc"|"enduml") { /* end of verbatim block */ copyToOutput(yyscanner,yytext,(int)yyleng); if (&yytext[4]==yyextra->blockName) @@ -526,7 +544,7 @@ MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z copyToOutput(yyscanner,yytext,(int)yyleng); } -<CComment>[^ <\\!@*\n{\"\/]* { /* anything that is not a '*' or command */ +<CComment>[^ `~<\\!@*\n{\"\/]* { /* anything that is not a '*' or command */ copyToOutput(yyscanner,yytext,(int)yyleng); } <CComment>"*"+[^*/\\@\n{\"]* { /* stars without slashes */ |