From fc740bb9d765934006e327180a96b9272f1b189a Mon Sep 17 00:00:00 2001 From: Xiao Yi Fang Date: Sat, 20 Jul 2024 09:34:22 +0800 Subject: [PATCH] 1 --- src/dict/stardict.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/dict/stardict.cc b/src/dict/stardict.cc index 308ba706..5251b603 100644 --- a/src/dict/stardict.cc +++ b/src/dict/stardict.cc @@ -448,9 +448,9 @@ string StardictDictionary::handleResource( char type, char const * resource, siz { QString articleText = QString( "
" ) + QString::fromUtf8( resource, size ) + "
"; - QRegularExpression imgRe( R"((<\s*(?:img|script)\s+[^>]*src\s*=\s*["']?)(?!(?:data|https?|ftp):))", + static QRegularExpression imgRe( R"((<\s*(?:img|script)\s+[^>]*src\s*=\s*["']?)(?!(?:data|https?|ftp):))", QRegularExpression::CaseInsensitiveOption ); - QRegularExpression linkRe( R"((<\s*link\s+[^>]*href\s*=\s*["']?)(?!(?:data|https?|ftp):))", + static QRegularExpression linkRe( R"((<\s*link\s+[^>]*href\s*=\s*["']?)(?!(?:data|https?|ftp):))", QRegularExpression::CaseInsensitiveOption ); articleText.replace( imgRe, "\\1bres://" + QString::fromStdString( getId() ) + "/" ) @@ -458,7 +458,7 @@ string StardictDictionary::handleResource( char type, char const * resource, siz // Handle links to articles - QRegularExpression linksReg( R"(]*)href\s*=\s*['"](bword://)?([^'"]+)['"])", + static QRegularExpression linksReg( R"(]*)href\s*=\s*['"](bword://)?([^'"]+)['"])", QRegularExpression::CaseInsensitiveOption ); @@ -545,8 +545,6 @@ string StardictDictionary::handleResource( char type, char const * resource, siz articleNewText.clear(); } - qDebug().noquote() << "StardictDictionary::handleResource: "<