diff --git a/slob.cc b/slob.cc index 8c1e4d51..42223cde 100644 --- a/slob.cc +++ b/slob.cc @@ -746,11 +746,11 @@ string SlobDictionary::convert( const string & in, RefEntry const & entry ) QString text = QString::fromUtf8( in.c_str() ); // pattern of img and script - text.replace( QRegExp( "<\\s*(img|script)\\s*([^>]*)src=\"(|/)([^\"]*)\"" ), + text.replace( QRegExp( "<\\s*(img|script)\\s*([^>]*)src=\"(?!(?:data|https?|ftp):)(|/)([^\"]*)\"" ), QString( "<\\1 \\2src=\"bres://%1/\\4\"").arg( getId().c_str() ) ); // pattern - text.replace( QRegExp( "<\\s*link\\s*([^>]*)href=\"" ), + text.replace( QRegExp( "<\\s*link\\s*([^>]*)href=\"(?!(?:data|https?|ftp):)" ), QString( ", excluding any known protocols such as http://, mailto:, #(comment)