diff options
author | albert-github <albert.tests@gmail.com> | 2019-06-17 12:23:28 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-06-17 12:23:28 (GMT) |
commit | b81d5b4c799e1180f5570ab8c8626ff46f3aa84a (patch) | |
tree | 4b0655d531ae170734f0481c5b1d506758b73b55 /src/docbookgen.cpp | |
parent | 4628578fe856f3ccfe3ade8f702671bfa1854566 (diff) | |
download | Doxygen-b81d5b4c799e1180f5570ab8c8626ff46f3aa84a.zip Doxygen-b81d5b4c799e1180f5570ab8c8626ff46f3aa84a.tar.gz Doxygen-b81d5b4c799e1180f5570ab8c8626ff46f3aa84a.tar.bz2 |
Incorrect (X)HTML code when generating source code.
When having the example:
```
/*! \file
* \brief
* Prerequisite header file
*/
//! \cond
#ifdef HAVE_CONFIG_H
#include "gmxpre-config.h"
#endif
//! \endcond
```
and we run xmllint on it:
```
xmllint --path .../testing/dtd --noout --nonet --postvalid html/*.html
```
we get the messages:
```
html/aa_8h_source.html:75: parser error : Opening and ending tag mismatch: div line 67 and body
</body>
^
html/aa_8h_source.html:76: parser error : Opening and ending tag mismatch: body line 17 and html
</html>
^
html/aa_8h_source.html:77: parser error : Premature end of data in tag html line 2
^
```
It looks like the problematic part in this case is the doxygen type comment at the end of the file.
In the past similar situations were present in LaTeX (related to maximum line length correction), but it was only fixed for LaTeX.
Besides the change for HTML also small changes were necessary for RTF and docbook.
Diffstat (limited to 'src/docbookgen.cpp')
-rw-r--r-- | src/docbookgen.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index c6bd1c0..7fe849a 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -185,7 +185,7 @@ void DocbookCodeGenerator::startCodeLine(bool) } void DocbookCodeGenerator::endCodeLine() { - m_t << endl; + if (m_insideCodeLine) m_t << endl; Docbook_DB(("(endCodeLine)\n")); m_lineNumber = -1; m_refId.resize(0); @@ -243,7 +243,7 @@ void DocbookCodeGenerator::addWord(const char *,bool) } void DocbookCodeGenerator::finish() { - if (m_insideCodeLine) endCodeLine(); + endCodeLine(); } void DocbookCodeGenerator::startCodeFragment() { @@ -251,6 +251,9 @@ void DocbookCodeGenerator::startCodeFragment() } void DocbookCodeGenerator::endCodeFragment() { + //endCodeLine checks is there is still an open code line, if so closes it. + endCodeLine(); + m_t << "</computeroutput></literallayout>" << endl; } @@ -1007,6 +1010,9 @@ DB_GEN_C void DocbookGenerator::endCodeFragment() { DB_GEN_C + //endCodeLine checks is there is still an open code line, if so closes it. + endCodeLine(); + t << "</programlisting>"; } void DocbookGenerator::startMemberTemplateParams() |