mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
fix: highlight a rare case when toPlainText omit space between two words
This commit is contained in:
parent
2da252539a
commit
1830415da5
|
@ -2503,6 +2503,12 @@ void ArticleView::highlightFTSResults()
|
|||
else
|
||||
regString = regString.remove( AccentMarkHandler::accentMark() );
|
||||
|
||||
//<div><i>watch</i>out</div> to plainText will return "watchout".
|
||||
//if application goes here,that means the article text must contains the search text.
|
||||
//whole word match regString will contain \b . can not match the above senario.
|
||||
//workaround ,remove \b from the regstring="(\bwatch\b)"
|
||||
regString.remove( QRegularExpression( "\\\\b" ) );
|
||||
|
||||
QRegularExpression regexp;
|
||||
if( Utils::Url::hasQueryItem( url, "wildcards" ) )
|
||||
regexp.setPattern( wildcardsToRegexp( regString ) );
|
||||
|
|
Loading…
Reference in a new issue