Fix Message Components for Tags with Attributes
Don't assume that the close tag is the length of the start tag +1 BUG: 482331
This commit is contained in:
@@ -307,13 +307,14 @@ int TextHandler::nextBlockPos(const QString &string)
|
||||
return string.size();
|
||||
}
|
||||
|
||||
int closeTagPos = string.indexOf(QStringLiteral("</%1>").arg(tagType));
|
||||
const auto closeTag = QStringLiteral("</%1>").arg(tagType);
|
||||
int closeTagPos = string.indexOf(closeTag);
|
||||
// If the close tag can't be found assume malformed html and process as single block.
|
||||
if (closeTagPos == -1) {
|
||||
return string.size();
|
||||
}
|
||||
|
||||
return closeTagPos + tag.size() + 1;
|
||||
return closeTagPos + closeTag.size();
|
||||
}
|
||||
|
||||
MessageComponent TextHandler::nextBlock(const QString &string,
|
||||
|
||||
Reference in New Issue
Block a user