diff options
-rw-r--r-- | src/qdoc/docparser.cpp | 11 | ||||
-rw-r--r-- | tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/excludes/parentinclude.qdoc | 5 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/qdoc/docparser.cpp b/src/qdoc/docparser.cpp index c6883fd6e..2bc296e1f 100644 --- a/src/qdoc/docparser.cpp +++ b/src/qdoc/docparser.cpp @@ -1346,9 +1346,11 @@ void DocParser::include(const QString &fileName, const QString &identifier, cons QStringList lineBuffer = includedContent.split(QLatin1Char('\n')); int i = 0; int startLine = -1; + QStringView trimmedLine; while (i < lineBuffer.size()) { - if (lineBuffer[i].startsWith("//!")) { - if (lineBuffer[i].contains(identifier)) { + trimmedLine = QStringView{lineBuffer[i]}.trimmed(); + if (trimmedLine.startsWith(QLatin1String("//!"))) { + if (trimmedLine.contains(identifier)) { startLine = i + 1; break; } @@ -1363,9 +1365,10 @@ void DocParser::include(const QString &fileName, const QString &identifier, cons QString result; i = startLine; do { - if (lineBuffer[i].startsWith("//!")) { + trimmedLine = QStringView{lineBuffer[i]}.trimmed(); + if (trimmedLine.startsWith(QLatin1String("//!"))) { if (i < lineBuffer.size()) { - if (lineBuffer[i].contains(identifier)) { + if (trimmedLine.contains(identifier)) { break; } } diff --git a/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/excludes/parentinclude.qdoc b/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/excludes/parentinclude.qdoc index 1cc47fd56..04007ac12 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/excludes/parentinclude.qdoc +++ b/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/excludes/parentinclude.qdoc @@ -12,11 +12,12 @@ */ /*! -//! children-qmlproperty + //! --- Observe the indented snippet tag: + //! children-qmlproperty \qmlproperty list<Child> AbstractParent::children \qmldefault \brief Children of the type. -//! children-qmlproperty + //! children-qmlproperty */ /*! |