Do not discard unknow commands

Hugo Lima <[email protected]>
Newsgroups gmane.text.doxygen.devel
Message-ID <[email protected]>
Hi;

I'm using doxygen to read the API documentaion of a third part
software, so I can't change the documentation inside the source code,
but doxygen give me a XML in their ouput and I can change it to
anything that I want, but there is a problem.

The documentation have some commands not recognized by doxygen, and
when doxygen find one of then it simply discard the comman characters
from the output, my patch tell doxygen to not discard unknow commands
characters.

I think that this patch do not affect the normal use of doxygen, the
current behaviour is undesired by the user, just as the new behaviour,
because the documentation must nto have any unknow commands.

Any comments?

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p

_______________________________________________
Doxygen-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doxygen-develop
doxygen_patch.diff (text/x-patch, 917 B)
Index: src/docparser.cpp
===================================================================
--- src/docparser.cpp	(revisão 687)
+++ src/docparser.cpp	(cópia de trabalho)
@@ -4506,6 +4506,7 @@
   {
     case CMD_UNKNOWN:
       warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Found unknown command `\\%s'",cmdName.data());
+      retval = 0;
       break;
     case CMD_EMPHASIS:
       m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,TRUE));
@@ -5637,7 +5638,11 @@
           DBG(("handleCommand returns %x\n",retval));
 
 	  // check the return value
-	  if (retval==RetVal_SimpleSec)
+      if (!retval)
+      {
+        m_children.append(new DocWord(this, '\\'+g_token->name));
+      }
+      else if (retval==RetVal_SimpleSec)
 	  {
 	    // Reparse the token that ended the section at this level,
 	    // so a new simple section will be started at this level.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.