@bhsd/codemirror-mediawiki 2.20.3 → 2.21.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/README.md +13 -0
- package/dist/escape.d.ts +2 -1
- package/dist/hover.d.ts +25 -0
- package/dist/main.min.js +18 -18
- package/dist/matchTag.d.ts +2 -2
- package/dist/mw.min.js +23 -23
- package/dist/mwConfig.mjs +14 -7
- package/dist/openLinks.d.ts +2 -1
- package/dist/ref.d.ts +3 -15
- package/dist/signature.d.ts +3 -0
- package/dist/wiki.min.js +23 -23
- package/i18n/en.json +4 -2
- package/i18n/zh-hans.json +4 -2
- package/i18n/zh-hant.json +4 -2
- package/mediawiki.css +18 -3
- package/package.json +30 -35
- package/dist/openExtLinks.d.ts +0 -2
- package/mw/config.ts +0 -185
- package/src/linter.ts +0 -149
- package/src/static.ts +0 -62
package/dist/mwConfig.mjs
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
// ../code-standard/dist/index.mjs
|
|
2
2
|
var CDN = "https://testingcf.jsdelivr.net";
|
|
3
|
-
var textarea;
|
|
4
|
-
if (typeof document === "object") {
|
|
5
|
-
textarea = document.createElement("textarea");
|
|
6
|
-
}
|
|
7
3
|
var getObject = (key) => JSON.parse(String(localStorage.getItem(key)));
|
|
8
4
|
var setObject = (key, value) => {
|
|
9
5
|
localStorage.setItem(key, JSON.stringify(value));
|
|
@@ -134,7 +130,17 @@ var getParserConfig = (minConfig, mwConfig) => {
|
|
|
134
130
|
if (config) {
|
|
135
131
|
return config;
|
|
136
132
|
}
|
|
137
|
-
const {
|
|
133
|
+
const {
|
|
134
|
+
tags,
|
|
135
|
+
nsid,
|
|
136
|
+
doubleUnderscore,
|
|
137
|
+
variants,
|
|
138
|
+
urlProtocols,
|
|
139
|
+
redirection,
|
|
140
|
+
functionSynonyms,
|
|
141
|
+
variableIDs,
|
|
142
|
+
img
|
|
143
|
+
} = mwConfig, [insensitive, sensitive] = functionSynonyms;
|
|
138
144
|
config = {
|
|
139
145
|
...minConfig,
|
|
140
146
|
ext: Object.keys(tags),
|
|
@@ -145,7 +151,8 @@ var getParserConfig = (minConfig, mwConfig) => {
|
|
|
145
151
|
),
|
|
146
152
|
variants,
|
|
147
153
|
protocol: urlProtocols.replace(/\|\\?\/\\?\//u, ""),
|
|
148
|
-
redirection: redirection != null ? redirection : minConfig.redirection
|
|
154
|
+
redirection: redirection != null ? redirection : minConfig.redirection,
|
|
155
|
+
...variableIDs && { variable: variableIDs }
|
|
149
156
|
};
|
|
150
157
|
if (location.hostname.endsWith(".moegirl.org.cn")) {
|
|
151
158
|
config.html[2].push("img");
|
|
@@ -158,7 +165,7 @@ var getParserConfig = (minConfig, mwConfig) => {
|
|
|
158
165
|
}
|
|
159
166
|
}
|
|
160
167
|
}
|
|
161
|
-
config.parserFunction[1] = "
|
|
168
|
+
config.parserFunction[1] = typeof wikiparse === "object" && compareVersion(wikiparse.version, "1.15") && !Object.values(sensitive).includes(true) ? { ...sensitive, "=": "=" } : [...Object.keys(sensitive), "="];
|
|
162
169
|
for (const [key, val] of Object.entries(img)) {
|
|
163
170
|
config.img[key] = val.slice(4);
|
|
164
171
|
}
|
package/dist/openLinks.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Extension } from '@codemirror/state';
|
|
2
2
|
import type { CodeMirror6 } from './codemirror';
|
|
3
3
|
export declare const isMac: boolean;
|
|
4
|
-
|
|
4
|
+
declare const _default: ({ langConfig }: CodeMirror6) => Extension;
|
|
5
|
+
export default _default;
|
package/dist/ref.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 异步查找注释的内容
|
|
6
|
-
* @param view
|
|
7
|
-
* @param target 目标名称
|
|
8
|
-
* @param all 是否查找所有
|
|
9
|
-
* @param group 是否group属性
|
|
10
|
-
*/
|
|
11
|
-
export declare const findRef: (view: EditorView | editor.ITextModel, target: string, all?: boolean, group?: boolean) => Promise<Ranges>;
|
|
12
|
-
export declare const refHover: ({
|
|
13
|
-
extension: import("@codemirror/state").Extension;
|
|
14
|
-
} | readonly import("@codemirror/state").Extension[])[];
|
|
15
|
-
export {};
|
|
1
|
+
import type { Extension } from '@codemirror/state';
|
|
2
|
+
declare const _default: Extension;
|
|
3
|
+
export default _default;
|