summaryrefslogtreecommitdiffstats
path: root/src/commentcnv.l
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-02-10 21:00:17 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-02-12 20:02:49 (GMT)
commitdc7729800038933a099f2b1c6409ee5210e248bb (patch)
tree8fa040d415cf3a3a0dc218f32aa325b83fe73456 /src/commentcnv.l
parentd0705323ef3fdc1db315ee8cd8326a7d0da5ced7 (diff)
downloadDoxygen-dc7729800038933a099f2b1c6409ee5210e248bb.zip
Doxygen-dc7729800038933a099f2b1c6409ee5210e248bb.tar.gz
Doxygen-dc7729800038933a099f2b1c6409ee5210e248bb.tar.bz2
Fix wrongly detecting ``` as code block inside running text.
Diffstat (limited to 'src/commentcnv.l')
-rw-r--r--src/commentcnv.l9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 5198a98..279f428 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -18,6 +18,9 @@
%option prefix="commentcnvYY"
%option reentrant
%option extra-type="struct commentcnvYY_state *"
+%top{
+#include <stdint.h>
+}
%{
@@ -349,7 +352,7 @@ 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 */
+<CComment,ReadLine>^[ \t]*("```"[`]*|"~~~"[~]*) { /* start of markdown code block */
if (!Config_getBool(MARKDOWN_SUPPORT))
{
REJECT;
@@ -357,7 +360,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);
yyextra->lastCommentContext = YY_START;
yyextra->javaBlock=0;
- yyextra->blockName=QCString(yytext).left(3);
+ yyextra->blockName=QCString(yytext).stripWhiteSpace().left(3);
BEGIN(VerbatimCode);
}
<CComment,ReadLine>[\\@]("dot"|"code"|"msc"|"startuml")/[^a-z_A-Z0-9] { /* start of a verbatim block */
@@ -475,7 +478,7 @@ MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z
}
}
}
-<Verbatim,VerbatimCode>[^@\/\\\n{}]* { /* any character not a backslash or new line or } */
+<Verbatim,VerbatimCode>[^`~@\/\\\n{}]* { /* any character not a backslash or new line or } */
copyToOutput(yyscanner,yytext,(int)yyleng);
}
<Verbatim,VerbatimCode>\n { /* new line in verbatim block */