summaryrefslogtreecommitdiffstats
path: root/src/xmlgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlgen.cpp')
-rw-r--r--src/xmlgen.cpp13
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 << "&lt;"; break;
+ case '>': t << "&gt;"; break;
+ case '&': t << "&amp;"; break;
+ case '\'': t << "&apos;"; break;
+ case '"': t << "&quot;"; 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