mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Fix javascripts paths in mdict format aren't replaced, which leads to .js files won't be loaded
This commit is contained in:
parent
32690a433b
commit
a9a18e7e26
7
mdx.cc
7
mdx.cc
|
@ -965,6 +965,13 @@ QString & MdxDictionary::filterResource( QString const & articleId, QString & ar
|
|||
.replace( QRegExp( "(<\\s*link\\s+[^>]*\\bhref\\b\\s*=\\s*)(?!['\"]+)(?!bres:|data:)(?:file://)?([^\\s>]+)",
|
||||
Qt::CaseInsensitive, QRegExp::RegExp2 ),
|
||||
"\\1\"bres://" + id + "/\\\"" )
|
||||
// javascripts
|
||||
.replace( QRegExp( "(<\\s*script\\s+[^>]*\\bsrc\\b\\s*=\\s*[\"']+)(?:file://)?[\\x00-\\x30\\x7f]*([^\"']*)",
|
||||
Qt::CaseInsensitive, QRegExp::RegExp2 ),
|
||||
"\\1bres://" + id + "/\\2" )
|
||||
.replace( QRegExp( "(<\\s*script\\s+[^>]*\\bsrc\\b\\s*=\\s*)(?!['\"]+)(?!bres:|data:)(?:file://)?([^\\s>]+)",
|
||||
Qt::CaseInsensitive, QRegExp::RegExp2 ),
|
||||
"\\1\"bres://" + id + "/\\\"" )
|
||||
// images
|
||||
.replace( QRegExp( "(<\\s*img\\s+[^>]*\\bsrc\\b\\s*=\\s*[\"']+)(?:file://)?[\\x00-\\x1f\\x7f]*([^\"']*)",
|
||||
Qt::CaseInsensitive, QRegExp::RegExp2 ),
|
||||
|
|
Loading…
Reference in a new issue