chore: make all the regexes static const
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
21c90527d2
commit
c5fd5e6ac1
37 changed files with 87 additions and 84 deletions
|
@ -213,11 +213,10 @@ QPair<QString, QString> StringUtils::splitFirst(const QString& s, const QRegular
|
|||
return qMakePair(left, right);
|
||||
}
|
||||
|
||||
static const QRegularExpression ulMatcher("<\\s*/\\s*ul\\s*>");
|
||||
|
||||
QString StringUtils::htmlListPatch(QString htmlStr)
|
||||
{
|
||||
int pos = htmlStr.indexOf(ulMatcher);
|
||||
static const QRegularExpression s_ulMatcher("<\\s*/\\s*ul\\s*>");
|
||||
int pos = htmlStr.indexOf(s_ulMatcher);
|
||||
int imgPos;
|
||||
while (pos != -1) {
|
||||
pos = htmlStr.indexOf(">", pos) + 1; // Get the size of the </ul> tag. Add one for zeroeth index
|
||||
|
@ -230,7 +229,7 @@ QString StringUtils::htmlListPatch(QString htmlStr)
|
|||
if (textBetween.isEmpty())
|
||||
htmlStr.insert(pos, "<br>");
|
||||
|
||||
pos = htmlStr.indexOf(ulMatcher, pos);
|
||||
pos = htmlStr.indexOf(s_ulMatcher, pos);
|
||||
}
|
||||
return htmlStr;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue