From fcb7d9fb380b714e1db9a279ceeba5af4cf59965 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 10 Aug 2018 14:33:14 +0200 Subject: Correcting labels for citations The labels for RTF and XML were incorrect due to the fact that the wrong branch was chosen in the code (the newAnchor was set for the results of the `\cite ` command as well). Small readability issue with XML (when there are a lot of citations). --- src/docparser.cpp | 11 ++++++----- src/xmldocvisitor.cpp | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index 7e050b3..0a9a10c 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1877,11 +1877,8 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor) { warn_doc_error(g_fileName,doctokenizerYYlineno,"Empty anchor label"); } - if (newAnchor) // found - { - m_anchor = id; - } - else if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix) + + if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix) { CiteInfo *cite = Doxygen::citeDict->find(id.mid(CiteConsts::anchorPrefix.length())); if (cite) @@ -1896,6 +1893,10 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor) m_file = "invalid"; } } + else if (newAnchor) // found + { + m_anchor = id; + } else // found \anchor label { SectionInfo *sec = Doxygen::sectionDict->find(id); diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 93765b1..adb2e33 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -488,7 +488,7 @@ void XmlDocVisitor::visitPre(DocPara *) void XmlDocVisitor::visitPost(DocPara *) { if (m_hide) return; - m_t << ""; + m_t << "" << endl; } void XmlDocVisitor::visitPre(DocRoot *) -- cgit v0.12 From e2306e7ff24e72d49893eb9ebc568b468298e236 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 10 Aug 2018 14:44:13 +0200 Subject: Correcting labels for citations Corrected change in test. --- testing/012/citelist.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/012/citelist.xml b/testing/012/citelist.xml index 96b94a3..f415968 100644 --- a/testing/012/citelist.xml +++ b/testing/012/citelist.xml @@ -9,7 +9,7 @@ - [1] + [1] DonaldE. Knuth. Tex and Metafont, New Directions in Typesetting. American Mathematical Society and Digital Press, Stanford, 1979. -- cgit v0.12