]*)href=['\"](bword://)?([^'\"]+)['\"]" );
int pos = 0;
while( pos >= 0 )
@@ -812,7 +812,7 @@ QString & GlsDictionary::filterResource( QString & article )
if( pos < 0 )
break;
- QString link = linksReg.cap( 2 );
+ QString link = linksReg.cap( 3 );
if( link.indexOf( ':' ) < 0 )
{
QString newLink;
diff --git a/stardict.cc b/stardict.cc
index b1b223a0..1235ffda 100644
--- a/stardict.cc
+++ b/stardict.cc
@@ -341,9 +341,9 @@ string StardictDictionary::handleResource( char type, char const * resource, siz
{
QString articleText = QString( "" ) + QString::fromUtf8( resource, size ) + "
";
- articleText.replace( QRegExp( "(<\\s*img\\s+[^>]*src\\s*=\\s*[\"']+)((?!data:)[^\"']*)", Qt::CaseInsensitive ),
+ articleText.replace( QRegExp( "(<\\s*img\\s+[^>]*src\\s*=\\s*[\"']+)((?!(data|https?|ftp):)[^\"']*)", Qt::CaseInsensitive ),
"\\1bres://" + QString::fromStdString( getId() ) + "/\\2" )
- .replace( QRegExp( "(<\\s*link\\s+[^>]*href\\s*=\\s*[\"']+)((?!data:)[^\"']*)", Qt::CaseInsensitive ),
+ .replace( QRegExp( "(<\\s*link\\s+[^>]*href\\s*=\\s*[\"']+)((?!(data|https?|ftp):)[^\"']*)", Qt::CaseInsensitive ),
"\\1bres://" + QString::fromStdString( getId() ) + "/\\2" );
// Handle links to articles