diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-08-10 10:33:21 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-11 06:15:29 +0000 |
commit | c3471eae66dccc454db11e811d6cf9c4f5259f2d (patch) | |
tree | a13f9584da0e553520d911afa5b1dfe4705687d5 | |
parent | 34aab820c9c73e519d348306201d12a5099e7035 (diff) |
shiboken6: Remove Python code snippet markers
Task-number: PYSIDE-1984
Task-number: PYSIDE-1952
Change-Id: I2e74b9c3d26c8d9fb60480c052189630ff54eded
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
(cherry picked from commit df9c852d6cd6a3aff5d93ff17fcee38dc9e7088b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp index fee07a73f..cf09abc16 100644 --- a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp +++ b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp @@ -623,15 +623,18 @@ QString QtXmlToSphinx::readFromLocation(const QString &location, const QString & const QRegularExpression searchString(u"//!\\s*\\["_s + identifier + u"\\]"_s); Q_ASSERT(searchString.isValid()); - static const QRegularExpression codeSnippetCode(u"//!\\s*\\[[\\w\\d\\s]+\\]"_s); - Q_ASSERT(codeSnippetCode.isValid()); + static const QRegularExpression cppCodeSnippetCode(u"//!\\s*\\[[\\w\\d\\s]+\\]"_s); + Q_ASSERT(cppCodeSnippetCode.isValid()); + static const QRegularExpression pythonCodeSnippetCode(u"#!\\s*\\[[\\w\\d\\s]+\\]"_s); + Q_ASSERT(pythonCodeSnippetCode.isValid()); bool getCode = false; while (!inputFile.atEnd()) { QString line = QString::fromUtf8(inputFile.readLine()); if (getCode && !line.contains(searchString)) { - line.remove(codeSnippetCode); + line.remove(cppCodeSnippetCode); + line.remove(pythonCodeSnippetCode); code += line; } else if (line.contains(searchString)) { if (getCode) |