diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2018-07-25 12:11:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-25 12:11:24 (GMT) |
commit | 19482da4a8a749fcde050d6268b0cf1f177b5be7 (patch) | |
tree | b00653507365ea20646aaeb69ac1b7decb5cb6f5 | |
parent | 452ef1661b8d35c4776f4d7e1e4551e523c3f46a (diff) | |
parent | f2b6959dff5b5d3d2bbbe8204b1fc32905003ad3 (diff) | |
download | Doxygen-19482da4a8a749fcde050d6268b0cf1f177b5be7.zip Doxygen-19482da4a8a749fcde050d6268b0cf1f177b5be7.tar.gz Doxygen-19482da4a8a749fcde050d6268b0cf1f177b5be7.tar.bz2 |
Merge pull request #6398 from albert-github/feature/bug_610436
Bug 610436 - <![CDATA[ is not handled inside C# comments
-rw-r--r-- | doc/xmlcmds.doc | 3 | ||||
-rw-r--r-- | src/commentscan.l | 36 |
2 files changed, 32 insertions, 7 deletions
diff --git a/doc/xmlcmds.doc b/doc/xmlcmds.doc index 501bf91..848858d 100644 --- a/doc/xmlcmds.doc +++ b/doc/xmlcmds.doc @@ -70,6 +70,9 @@ Here is the list of tags supported by doxygen: <li><tt>\<typeparamref name="paramName"\></tt> Refers to a parameter with name "paramName". Similar to using \ref cmda "\\a". <li><tt>\<value\></tt> Identifies a property. Ignored by doxygen. +<li><tt>\<![CDATA[...]]\></tt> The text inside this tag (on the ...) is handled as normal + doxygen comment except for the XML special characters `<`, `>` and + `&` that are used as if they were escaped. </ul> Here is an example of a typical piece of code using some of the above commands: diff --git a/src/commentscan.l b/src/commentscan.l index c364312..8488e6c 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -990,6 +990,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" %x CiteLabel %x CopyDoc %x GuardExpr +%x CdataSection %% @@ -1082,13 +1083,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) @@ -1332,6 +1336,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 |