summaryrefslogtreecommitdiffstats
path: root/src/docparser.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2006-12-02 14:54:35 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2006-12-02 14:54:35 (GMT)
commitd2d57f02eabbe81ea976f31e2af66c80c01a2a0b (patch)
tree0af428e60324ef94f5e04cee664374d5907c36ac /src/docparser.cpp
parentd384b6c7459cffcbb30bdd0ab06bde6f0cd12688 (diff)
downloadDoxygen-d2d57f02eabbe81ea976f31e2af66c80c01a2a0b.zip
Doxygen-d2d57f02eabbe81ea976f31e2af66c80c01a2a0b.tar.gz
Doxygen-d2d57f02eabbe81ea976f31e2af66c80c01a2a0b.tar.bz2
Release-1.5.1-20061202
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r--src/docparser.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index d28164f..a2a7ef0 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
*
* Copyright (C) 1997-2006 by Dimitri van Heesch.
@@ -2037,6 +2037,34 @@ DocRef::DocRef(DocNode *parent,const QString &target) :
target.data());
}
+static void flattenParagraphs(QList<DocNode> &children)
+{
+ QListIterator<DocNode> li(children);
+ QList<DocNode> newChildren;
+ DocNode *dn;
+ for (li.toFirst();(dn=li.current());++li)
+ {
+ if (dn->kind()==DocNode::Kind_Para)
+ {
+ DocPara *para = (DocPara*)dn;
+ QList<DocNode> &paraChildren = para->children();
+ paraChildren.setAutoDelete(FALSE); // unlink children from paragraph node
+ QListIterator<DocNode> li2(paraChildren);
+ DocNode *dn2;
+ for (li2.toFirst();(dn2=li2.current());++li2)
+ {
+ newChildren.append(dn2); // add them to new node
+ }
+ }
+ }
+ children.clear();
+ QListIterator<DocNode> li3(newChildren);
+ for (li3.toFirst();(dn=li3.current());++li3)
+ {
+ children.append(dn);
+ }
+}
+
void DocRef::parse()
{
g_nodeStack.push(this);
@@ -2072,6 +2100,7 @@ void DocRef::parse()
internalValidatingParseDoc(this,m_children,m_text);
docParserPopContext();
g_insideHtmlLink=FALSE;
+ flattenParagraphs(m_children);
}
handlePendingStyleCommands(this,m_children);
@@ -4799,6 +4828,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
{
DocRef *ref = new DocRef(this,cref);
m_children.append(ref);
+ ref->parse();
}
else
{