Full-text search: handle <q> tag as words break

This commit is contained in:
Abs62 2018-08-15 11:59:13 +03:00
parent 11b333c2e8
commit 61325acdb9

View file

@ -152,11 +152,11 @@ QString unescape( QString const & str, bool saveFormat )
if( !saveFormat )
{
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
tmp.replace( QRegularExpression( "<(?:\\s*/?(?:div|h[1-6r]|p(?![alr])|br|li(?![ns])|td|blockquote|[uo]l|pre|d[dl]|nav|address))[^>]{0,}>",
tmp.replace( QRegularExpression( "<(?:\\s*/?(?:div|h[1-6r]|q|p(?![alr])|br|li(?![ns])|td|blockquote|[uo]l|pre|d[dl]|nav|address))[^>]{0,}>",
QRegularExpression::CaseInsensitiveOption ), " " );
tmp.remove( QRegularExpression( "<[^>]*>" ) );
#else
tmp.replace( QRegExp( "<(?:\\s*/?(?:div|h[1-6r]|p(?![alr])|br|li(?![ns])|td|blockquote|[uo]l|pre|d[dl]|nav|address))[^>]{0,}>",
tmp.replace( QRegExp( "<(?:\\s*/?(?:div|h[1-6r]|q|p(?![alr])|br|li(?![ns])|td|blockquote|[uo]l|pre|d[dl]|nav|address))[^>]{0,}>",
Qt::CaseInsensitive, QRegExp::RegExp2 ), " " );
tmp.remove( QRegExp( "<[^>]*>", Qt::CaseSensitive, QRegExp::RegExp2 ) );
#endif