summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasper van Donderen <casper.vandonderen@nokia.com>2012-05-29 15:42:01 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-30 11:13:46 +0200
commit28ae5aa332f00920bd29d876159d6b92922798dc (patch)
tree10f3fe27579a4f7928fa3e8cb5dbbdecb55ef500
parent4f539b2671988f73107db4391faa7a6ad539009b (diff)
QDoc: Force writing \n before a snippet in DITAXML.
Previously the snippet text would be indented, which causes an XSLT to render the first line of a snippet at the indentation level of the .dita file. Change-Id: Iead8d07277f83ca5ccbf463f1cdb1c8210459d56 Reviewed-by: Martin Smith <martin.smith@nokia.com>
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp
index 9c84c43bd3..c448f0e413 100644
--- a/src/tools/qdoc/ditaxmlgenerator.cpp
+++ b/src/tools/qdoc/ditaxmlgenerator.cpp
@@ -828,14 +828,15 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
{
writeStartTag(DT_codeblock);
xmlWriter().writeAttribute("outputclass","cpp");
- QString chars = trimmedTrailing(atom->string());
- writeText(chars, marker, relative);
+ writeCharacters("\n");
+ writeText(trimmedTrailing(atom->string()), marker, relative);
writeEndTag(); // </codeblock>
}
break;
case Atom::Qml:
writeStartTag(DT_codeblock);
xmlWriter().writeAttribute("outputclass","qml");
+ writeCharacters("\n");
writeText(trimmedTrailing(atom->string()), marker, relative);
writeEndTag(); // </codeblock>
break;
@@ -844,6 +845,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
xmlWriter().writeCharacters("you can rewrite it as");
writeEndTag(); // </p>
writeStartTag(DT_codeblock);
+ writeCharacters("\n");
writeText(trimmedTrailing(atom->string()), marker, relative);
writeEndTag(); // </codeblock>
break;
@@ -854,6 +856,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
// fallthrough
case Atom::CodeBad:
writeStartTag(DT_codeblock);
+ writeCharacters("\n");
writeCharacters(trimmedTrailing(plainCode(atom->string())));
writeEndTag(); // </codeblock>
break;