diff options
Diffstat (limited to 'src/xmlgen.cpp')
-rw-r--r-- | src/xmlgen.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index c1574eb..8fade1a 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -58,7 +58,16 @@ inline void writeXMLCodeString(QTextStream &t,const char *s) char c; while ((c=*s++)) { - if (c==' ') t << "<sp/>"; else t << c; + switch(c) + { + case ' ': t << "<sp/>"; break; + case '<': t << "<"; break; + case '>': t << ">"; break; + case '&': t << "&"; break; + case '\'': t << "'"; break; + case '"': t << """; break; + default: t << c; break; + } } } @@ -367,7 +376,7 @@ static void writeXMLDocBlock(QTextStream &t, QCString stext = text.stripWhiteSpace(); if (stext.isEmpty()) return; // convert the documentation string into an abstract syntax tree - DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,stext,FALSE); + DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,text+"\n",FALSE); // create a code generator XMLCodeGenerator *xmlCodeGen = new XMLCodeGenerator(t); // create a parse tree visitor for XML |