@bhsd/codemirror-mediawiki 2.23.0 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/linter.mjs +3 -3
- package/dist/main.min.js +18 -18
- package/dist/mw.min.js +22 -22
- package/dist/mwConfig.mjs +81 -43
- package/dist/static.d.ts +1 -1
- package/dist/token.d.ts +3 -7
- package/dist/wiki.min.js +22 -22
- package/i18n/en.json +1 -1
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/package.json +4 -4
package/dist/linter.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadScript, getLSP, sanitizeInlineStyle } from "@bhsd/common";
|
|
2
2
|
import { styleLint } from "@bhsd/common/dist/stylelint";
|
|
3
3
|
const offsetAt = (range, line, column) => {
|
|
4
4
|
if (line === -2) {
|
|
@@ -7,12 +7,12 @@ const offsetAt = (range, line, column) => {
|
|
|
7
7
|
return line === 0 ? range[1] : range[0] + column;
|
|
8
8
|
};
|
|
9
9
|
const getWikiLinter = async (opt, obj) => {
|
|
10
|
-
const
|
|
10
|
+
const DIR = "npm/wikiparser-node/extensions/dist", lang = opt == null ? void 0 : opt["i18n"];
|
|
11
11
|
await loadScript(`${DIR}/base.min.js`, "wikiparse");
|
|
12
12
|
await loadScript(`${DIR}/lsp.min.js`, "wikiparse.LanguageService");
|
|
13
13
|
if (typeof lang === "string") {
|
|
14
14
|
try {
|
|
15
|
-
const i18n = await (await fetch(`${CDN}
|
|
15
|
+
const i18n = await (await fetch(`${wikiparse.CDN}/i18n/${lang.toLowerCase()}.json`)).json();
|
|
16
16
|
wikiparse.setI18N(i18n);
|
|
17
17
|
} catch {
|
|
18
18
|
}
|