From 5982b1d337d0bbdedec675279c3f264a30f7ab26 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Wed, 4 Dec 2024 12:03:06 +0800 Subject: [PATCH 1/2] Revert "fix: " ) ) - .arg( article.mid( linkPos, match.capturedStart() - linkPos ) ); + articleNewText += article.mid( linkPos, match.capturedEnd() - linkPos ); linkPos = match.capturedEnd(); } continue; diff --git a/src/scripts/gd-builtin.js b/src/scripts/gd-builtin.js index 45c5971a..d9421c0f 100644 --- a/src/scripts/gd-builtin.js +++ b/src/scripts/gd-builtin.js @@ -1,11 +1,3 @@ -function gdOnReady(func) { - if (document.readyState !== "loading") { - func(); - } else { - document.addEventListener("DOMContentLoaded", func); - } -} - function gdMakeArticleActive(newId, noEvent) { const gdCurrentArticle = document.querySelector(".gdactivearticle").attributes.id; From 612dc8db0fff6871d95c2ff113dd344667c5dd20 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Wed, 4 Dec 2024 12:04:21 +0800 Subject: [PATCH 2/2] Revert "opt: [mdx]js script with defer attribute (#1869)" This reverts commit 939e78633165c1cb1908ece5448139d8bea49b41. --- src/dict/mdx.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/dict/mdx.cc b/src/dict/mdx.cc index 49a15bb1..35c769f3 100644 --- a/src/dict/mdx.cc +++ b/src/dict/mdx.cc @@ -959,7 +959,7 @@ void MdxDictionary::replaceLinks( QString & id, QString & article ) continue; } else { - //audio ,script,video ,html5 tags fall here. + //audio ,video ,html5 tags fall here. match = RX::Mdx::srcRe.match( linkTxt ); if ( match.hasMatch() ) { QString newText; @@ -971,15 +971,9 @@ void MdxDictionary::replaceLinks( QString & id, QString & article ) else { scheme = "bres://"; } - newText = match.captured( 1 ) + match.captured( 2 ) + scheme + id + "/" + match.captured( 3 ) + match.captured( 2 ); - //add defer to script tag - if ( linkType.compare( "script" ) == 0 ) { - newText = newText + " defer "; - } - newLink = linkTxt.replace( match.capturedStart(), match.capturedLength(), newText ); } else {