@bhsd/codemirror-mediawiki 3.6.5 → 3.6.6
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/codemirror.d.ts +1 -0
- package/dist/codemirror.js +3 -2
- package/dist/color.js +1 -1
- package/dist/fold.d.ts +1 -1
- package/dist/main.min.js +2 -2
- package/dist/mediawiki.js +2 -1
- package/dist/mw.min.js +25 -25
- package/dist/mwConfig.js +2 -10
- package/dist/static.js +1 -1
- package/dist/statusBar.js +1 -1
- 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/mwConfig.js
CHANGED
|
@@ -4,11 +4,6 @@ var getObject = (key) => JSON.parse(String(localStorage.getItem(key)));
|
|
|
4
4
|
var setObject = (key, value) => {
|
|
5
5
|
localStorage.setItem(key, JSON.stringify(value));
|
|
6
6
|
};
|
|
7
|
-
var parseVersion = (version) => version.split(".", 3).map(Number);
|
|
8
|
-
var compareVersion = (version, baseVersion) => {
|
|
9
|
-
const [major, minor] = parseVersion(version), [baseMajor, baseMinor] = parseVersion(baseVersion);
|
|
10
|
-
return major > baseMajor || major === baseMajor && minor >= baseMinor;
|
|
11
|
-
};
|
|
12
7
|
|
|
13
8
|
// ../cm-util/dist/index.mjs
|
|
14
9
|
var otherParserFunctions = /* @__PURE__ */ new Set(["msg", "raw", "subst", "safesubst"]);
|
|
@@ -113,7 +108,7 @@ var getStaticMwConfig = ({
|
|
|
113
108
|
...p0,
|
|
114
109
|
...Object.fromEntries(p2.flat().map((s) => [s, s]))
|
|
115
110
|
},
|
|
116
|
-
|
|
111
|
+
{ ...p1 }
|
|
117
112
|
],
|
|
118
113
|
urlProtocols: `${protocol}|//`,
|
|
119
114
|
nsid,
|
|
@@ -209,7 +204,7 @@ var getParserConfig2 = (minConfig, mwConfig) => {
|
|
|
209
204
|
if (config) {
|
|
210
205
|
return config;
|
|
211
206
|
}
|
|
212
|
-
const { nsid, variants, functionSynonyms, img } = mwConfig, [insensitive
|
|
207
|
+
const { nsid, variants, functionSynonyms, img } = mwConfig, [insensitive] = functionSynonyms;
|
|
213
208
|
config = {
|
|
214
209
|
...getParserConfig(minConfig, mwConfig),
|
|
215
210
|
namespaces: mw.config.get("wgFormattedNamespaces"),
|
|
@@ -225,9 +220,6 @@ var getParserConfig2 = (minConfig, mwConfig) => {
|
|
|
225
220
|
config.parserFunction[0][`#${key}`] = val;
|
|
226
221
|
}
|
|
227
222
|
}
|
|
228
|
-
if (typeof wikiparse !== "object" || !compareVersion(wikiparse.version, "1.15") || Object.values(sensitive).includes(true)) {
|
|
229
|
-
config.parserFunction[1] = Object.keys(config.parserFunction[1]);
|
|
230
|
-
}
|
|
231
223
|
for (const [key, val] of Object.entries(img)) {
|
|
232
224
|
config.img[key] = val.slice(4).replace(/_/gu, "-");
|
|
233
225
|
}
|
package/dist/static.js
CHANGED
|
@@ -35,7 +35,7 @@ export const getStaticMwConfig = ({ variable, parserFunction: [p0, p1, ...p2], p
|
|
|
35
35
|
...p0,
|
|
36
36
|
...Object.fromEntries(p2.flat().map(s => [s, s])),
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
{ ...p1 },
|
|
39
39
|
],
|
|
40
40
|
urlProtocols: `${protocol}|//`,
|
|
41
41
|
nsid,
|
package/dist/statusBar.js
CHANGED
|
@@ -66,7 +66,7 @@ const updateMenu = (cm, allDiagnostics, main, classList, optionAll, menu, fixer)
|
|
|
66
66
|
if (menu) {
|
|
67
67
|
const actionable = menuRegistry.filter(({ name, isActionable }) => cm.hasPreference(name) && isActionable(cm)), fixable = new Set(fixer && getDiagnostics(allDiagnostics, main).filter(({ actions }) => actions?.some(({ name }) => name === 'fix'
|
|
68
68
|
|| name !== 'Fix: Stylelint' && name.startsWith('Fix:'))).map(({ message }) => / \(([^()]+)\)$/u.exec(message)?.[1])
|
|
69
|
-
.filter(
|
|
69
|
+
.filter(message => message !== undefined));
|
|
70
70
|
if (actionable.length === 0 && fixable.size === 0) {
|
|
71
71
|
toggleClass(classList, false);
|
|
72
72
|
return;
|