diff options
author | albert-github <albert.tests@gmail.com> | 2018-07-19 16:56:38 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2018-07-19 16:56:38 (GMT) |
commit | f2b6959dff5b5d3d2bbbe8204b1fc32905003ad3 (patch) | |
tree | a105c94d2a10f8decc404287269d886d39a0a2b7 /src/commentscan.l | |
parent | 3e310e8d977ab9a3341c6d40336337f530ed9e4c (diff) | |
download | Doxygen-f2b6959dff5b5d3d2bbbe8204b1fc32905003ad3.zip Doxygen-f2b6959dff5b5d3d2bbbe8204b1fc32905003ad3.tar.gz Doxygen-f2b6959dff5b5d3d2bbbe8204b1fc32905003ad3.tar.bz2 |
Bug 610436 - <![CDATA[ is not handled inside C# comments
Added handling of "<![CDATA[ ... ]]>" i.e. XML CDATA sections in an analogous way top HTML comment but in this case the text is retained (as normal doxygen comment) and the special XML characters `<`,`>` and `&` are taken as if they were escaped.
Diffstat (limited to 'src/commentscan.l')
-rw-r--r-- | src/commentscan.l | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index aae403d..42318d1 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -989,6 +989,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" %x CiteLabel %x CopyDoc %x GuardExpr +%x CdataSection %% @@ -1081,13 +1082,16 @@ RCSTAG "$"{ID}":"[^\n$]+"$" insidePre=FALSE; addOutput(yytext); } -<Comment>{RCSTAG} { // RCS tag which end a brief description - setOutput(OutputDoc); - REJECT; - } -<Comment>"<!--" { - BEGIN(HtmlComment); - } +<Comment>{RCSTAG} { // RCS tag which end a brief description + setOutput(OutputDoc); + REJECT; + } +<Comment>"<!--" { + BEGIN(HtmlComment); + } +<Comment>"<!\[CDATA\[" { + BEGIN(CdataSection); + } <Comment>{B}*{CMD}"endinternal"{B}* { addOutput("\\endinternal "); if (!inInternalDocs) @@ -1318,6 +1322,24 @@ RCSTAG "$"{ID}":"[^\n$]+"$" <HtmlComment>. { // ignore every else } +<CdataSection>"\]\]>" { + BEGIN( Comment ); + } +<CdataSection>{DOCNL} { + addOutput('\n'); + if (*yytext=='\n') yyLineNr++; + } +<CdataSection>[<>&] { // the special XML characters for iwhich the CDATA section is especially used + addOutput('\\'); + addOutput(*yytext); + } +<CdataSection>[^\\\n\]<>&]+ { + addOutput(yytext); + } +<CdataSection>. { + addOutput(*yytext); + } + /* -------------- Rules for handling formulas ---------------- */ <ReadFormulaShort>{CMD}"f$" { // end of inline formula |