diff options
Diffstat (limited to 'src/qdoc/xmlgenerator.cpp')
-rw-r--r-- | src/qdoc/xmlgenerator.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/qdoc/xmlgenerator.cpp b/src/qdoc/xmlgenerator.cpp index d16a217d4..58efe1cea 100644 --- a/src/qdoc/xmlgenerator.cpp +++ b/src/qdoc/xmlgenerator.cpp @@ -183,7 +183,21 @@ std::pair<QString, QString> XmlGenerator::getTableWidthAttr(const Atom *atom) else if (p1.contains(QLatin1Char('%'))) width = p1; } - return std::pair<QString, QString>(width, attr); + + // Many times, in the documentation, there is a space before the % sign: + // this breaks the parsing logic above. + if (width == QLatin1String("%")) { + // The percentage is typically stored in p0, parse it as an int. + bool ok = false; + int widthPercentage = p0.toInt(&ok); + if (ok) { + width = QString::number(widthPercentage) + "%"; + } else { + width = {}; + } + } + + return {width, attr}; } /*! |