Skip to content

Commit

Permalink
Update MediaWiki:Gadget-wikieditor-highlight.js (#412)
Browse files Browse the repository at this point in the history
* Update MediaWiki:Gadget-wikieditor-highlight.js

大更新

* Update MediaWiki:Gadget-wikieditor-highlight.js

让用户自行选择加载的插件
  • Loading branch information
bhsd-harry authored Feb 1, 2024
1 parent 06bb72a commit 07be516
Showing 1 changed file with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,11 @@
const script = document.createElement("script");
script.addEventListener("load", resolve);
script.type = "module";
script.src = "https://testingcf.jsdelivr.net/npm/@bhsd/codemirror-mediawiki/mw/dist/base.js";
script.src = "https://testingcf.jsdelivr.net/npm/@bhsd/codemirror-mediawiki/dist/mw.min.js";
document.head.append(script);
});
}
cm = await window.CodeMirror6.fromTextArea($textarea[0], lang);
cm.prefer([
"highlightSpecialChars",
"highlightActiveLine",
"bracketMatching",
"closeBrackets",
"allowMultipleSelections",
]);
const [config] = await Promise.all([
libCachedCode.getCachedCode("https://testingcf.jsdelivr.net/npm/wikiparser-node/config/moegirl.json"),
cm.defaultLint(true, { include: [2, 10, 828].includes(ns) }),
]);
try {
window.wikiparse?.setConfig(JSON.parse(config));
} catch (e) {
console.error(e);
}
window.CodeMirror6.fromTextArea($textarea[0], lang, ns);
};
if (!isAdvanced) {
init();
Expand Down

0 comments on commit 07be516

Please sign in to comment.