Skip to content

Commit

Permalink
fix(gadget-prism): no unicode flag (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsd-harry committed Apr 22, 2024
1 parent 7f87d74 commit ba203ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
const wiki = {};
Prism.languages.wiki = wiki;

await libCachedCode.injectCachedCode("/MediaWiki:Gadget-wikiparser-node.js?action=raw&ctype=text/javascript", "script");
Parser.config = await (await fetch("/MediaWiki:Gadget-prism-language-wiki.json?action=raw&ctype=application/json")).json();
const keyword = "keyword",
url = "url",
Expand Down
4 changes: 2 additions & 2 deletions src/gadgets/prism-language-wiki/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ rights:

peers: []

dependencies: []
dependencies:
- ext.gadget.libCachedCode

_sites:
- zh
Expand All @@ -31,6 +32,5 @@ _sites:
_section: system

_files:
- MediaWiki:Gadget-wikiparser-node.js
- MediaWiki:Gadget-prism-language-wiki.js
- MediaWiki:Gadget-prism-language-wiki.json
2 changes: 1 addition & 1 deletion src/gadgets/prism/MediaWiki:Gadget-prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ $(() => {
};
// 仅用于判断是否合法语言,无需去重
const acceptsLangNames = Object.values(acceptsLangs);
let hash = /^#L\d+$/u.test(location.hash);
let hash = /^#L\d+$/.test(location.hash);
Prism.hooks.add("complete", ({ element }) => {
if (element) {
const { dataset: { start = 1 } } = element.parentElement;
Expand Down

0 comments on commit ba203ef

Please sign in to comment.