diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-02-09 17:36:36 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-23 16:03:33 +0000 |
commit | 6507dbe2fbbbfc9b085e8554ca330bfd7681ed89 (patch) | |
tree | 10313802614090cf31785a96bb3c52b0c842147b | |
parent | ed834cf30ad18db21ca19626b707366d2330226a (diff) | |
download | qttools-6507dbe2fbbbfc9b085e8554ca330bfd7681ed89.tar.gz |
Remove quotes from the front/back of tags
Generalize stripping of unwanted characters to strip any (number of)
punctuation characters from the beginning and end of tags.
The most common characters in this class are !"#%&'()*,-./:;?@[\]_{}
Fixes: QTBUG-100139
Change-Id: I096f3ff9b6ef6a19fe0a54f8881b9235e8d30055
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit e4cd2c5b26c4c01e3218cedc7baf23fadf51264a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qdoc/manifestwriter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qdoc/manifestwriter.cpp b/src/qdoc/manifestwriter.cpp index f47e64ebb..3d3d9e86a 100644 --- a/src/qdoc/manifestwriter.cpp +++ b/src/qdoc/manifestwriter.cpp @@ -312,12 +312,13 @@ void ManifestWriter::cleanUpTags() QSet<QString> cleanedTags; for (auto tag : m_tags) { - if (tag.at(0) == '(') - tag.remove(0, 1).chop(1); - if (tag.endsWith(QLatin1Char(':'))) + // strip punctuation characters from start and end + while (!tag.isEmpty() && tag.at(0).isPunct()) + tag.remove(0, 1); + while (!tag.isEmpty() && tag.back().isPunct()) tag.chop(1); - if (tag.length() < 2 || tag.at(0).isDigit() || tag.at(0) == '-' + if (tag.length() < 2 || tag.at(0).isDigit() || tag == QLatin1String("qt") || tag == QLatin1String("the") || tag == QLatin1String("and") || tag == QLatin1String("doc") || tag.startsWith(QLatin1String("example")) || tag.startsWith(QLatin1String("chapter"))) |