mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
MDict: ltrim unprintable characters from filename
This commit is contained in:
parent
3154e32afc
commit
58654a7423
6
mdx.cc
6
mdx.cc
|
@ -795,10 +795,12 @@ string MdxDictionary::filterResource( const char * articleId, const char * artic
|
|||
QString::fromStdString( addAudioLink( "\"gdau://" + getId() + "/\\2\"", getId() ) ) +
|
||||
"\\1gdau://" + QString::fromStdString( getId() ) + "/\\2" )
|
||||
// stylesheets
|
||||
.replace( QRegExp( "(<\\s*link\\s+[^>]*href\\s*=\\s*[\"']+)(file://)?([^\"']*)", Qt::CaseInsensitive ),
|
||||
.replace( QRegExp( "(<\\s*link\\s+[^>]*href\\s*=\\s*[\"']+)(file://)?[\\x00-\\x30\\x7f]*([^\"']*)",
|
||||
Qt::CaseInsensitive, QRegExp::RegExp2 ),
|
||||
"\\1bres://" + QString::fromStdString( getId() ) + "/\\3" )
|
||||
// images
|
||||
.replace( QRegExp( "(<\\s*img\\s+[^>]*src\\s*=\\s*[\"']+)(file://)?([^\"']*)", Qt::CaseInsensitive ),
|
||||
.replace( QRegExp( "(<\\s*img\\s+[^>]*src\\s*=\\s*[\"']+)(file://)?[\\x00-\\x30\\x7f]*([^\"']*)",
|
||||
Qt::CaseInsensitive, QRegExp::RegExp2 ),
|
||||
"\\1bres://" + QString::fromStdString( getId() ) + "/\\3" )
|
||||
.toUtf8().constData() );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue