@bhsd/codemirror-mediawiki 2.25.6 → 2.27.0
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 +11 -6
- package/dist/config.d.ts +1 -0
- package/dist/css.d.ts +3 -0
- package/dist/javascript.d.ts +3 -0
- package/dist/keybindings.d.mts +15 -0
- package/dist/keybindings.d.ts +15 -0
- package/dist/keybindings.mjs +34 -0
- package/dist/lua.d.ts +3 -0
- package/dist/main.min.js +19 -19
- package/dist/mw.min.js +23 -23
- package/dist/token.d.ts +13 -6
- package/dist/wiki.min.js +23 -23
- package/i18n/en.json +1 -1
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/mediawiki.css +1 -1
- package/package.json +7 -6
- package/dist/plugins.d.ts +0 -7
package/README.md
CHANGED
|
@@ -586,24 +586,29 @@ CTRL/CMD-click opens a link in a new tab.
|
|
|
586
586
|
### Extension
|
|
587
587
|
|
|
588
588
|
1. [Extension:Translate](https://www.mediawiki.org/wiki/Extension:Translate) is not supported.
|
|
589
|
+
1. [Extension:Poem](https://www.mediawiki.org/wiki/Extension:Poem) should prevent preformatted text ([Example](http://bhsd-harry.github.io/monaco-wiki/tests.html#%3Cpoem%3E%20with%20leading%20whitespace)).
|
|
589
590
|
|
|
590
591
|
### Transclusion
|
|
591
592
|
|
|
592
|
-
1.
|
|
593
|
+
1. Substitution is not correctly highlighted ([Example](http://bhsd-harry.github.io/monaco-wiki/tests.html#Scribunto%3A%20isSubsting%20during%20PST)).
|
|
594
|
+
1. Non-existing parser functions starting with `#` are highlighted as parser functions ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Parsoid%3A%20unknown%20parser%20function%20(T314524))).
|
|
593
595
|
1. Wikitext in template parameter names is not highlighted ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Templates%3A%20Other%20wikitext%20in%20parameter%20names%20(T69657))).
|
|
594
596
|
1. Template parameter names followed by a newline are not recognized ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Templates%3A%20Handle%20comments%20in%20parameter%20names%20(T69657))).
|
|
595
597
|
|
|
596
|
-
###
|
|
598
|
+
### Heading
|
|
597
599
|
|
|
598
|
-
1.
|
|
599
|
-
|
|
600
|
-
|
|
600
|
+
1. Comments at the SOL break section headings ([Example](https://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Section%20extraction%20prefixed%20by%20comment%20(section%201))).
|
|
601
|
+
|
|
602
|
+
### Table
|
|
603
|
+
|
|
604
|
+
1. Comments at the SOL break table syntax ([Example](https://bhsd-harry.github.io/codemirror-mediawiki/tests.html#3c.%20Table%20cells%20without%20escapable%20prefixes%20after%20edits)).
|
|
601
605
|
|
|
602
606
|
### External link
|
|
603
607
|
|
|
608
|
+
1. IPv6 addresses are not supported ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#IPv6%20urls%2C%20autolink%20format%20(T23261))).
|
|
604
609
|
1. External links inside double brackets are highlighted incorrectly ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
|
|
605
610
|
|
|
606
611
|
### Block element
|
|
607
612
|
|
|
608
613
|
1. Comments at the SOL break the highlighting ([Example](https://bhsd-harry.github.io/codemirror-mediawiki/tests.html#1.%20Lists%20with%20start-of-line-transparent%20tokens%20before%20bullets%3A%20Comments)).
|
|
609
|
-
1. False positives of preformatted text when there are categories ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Category%20%2F%20paragraph%20interactions)).
|
|
614
|
+
1. False positives of preformatted text when there are categories ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Category%20%2F%20paragraph%20interactions)) or HTML tags ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Parsing%20optional%20HTML%20elements%20(T8171))).
|
package/dist/config.d.ts
CHANGED
package/dist/css.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface KeymapConfig {
|
|
2
|
+
key: string;
|
|
3
|
+
desc: string;
|
|
4
|
+
pre?: string;
|
|
5
|
+
post?: string;
|
|
6
|
+
splitlines?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const keybindings: KeymapConfig[];
|
|
9
|
+
/**
|
|
10
|
+
* 将文本各行包裹在指定的前后缀中
|
|
11
|
+
* @param text 跨行文本
|
|
12
|
+
* @param pre 前缀
|
|
13
|
+
* @param post 后缀
|
|
14
|
+
*/
|
|
15
|
+
export declare const encapsulateLines: (text: string, pre: string, post: string) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface KeymapConfig {
|
|
2
|
+
key: string;
|
|
3
|
+
desc: string;
|
|
4
|
+
pre?: string;
|
|
5
|
+
post?: string;
|
|
6
|
+
splitlines?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const keybindings: KeymapConfig[];
|
|
9
|
+
/**
|
|
10
|
+
* 将文本各行包裹在指定的前后缀中
|
|
11
|
+
* @param text 跨行文本
|
|
12
|
+
* @param pre 前缀
|
|
13
|
+
* @param post 后缀
|
|
14
|
+
*/
|
|
15
|
+
export declare const encapsulateLines: (text: string, pre: string, post: string) => string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const keybindings = [
|
|
2
|
+
{ key: "Ctrl-8", pre: "<blockquote>", post: "</blockquote>", desc: "blockquote" },
|
|
3
|
+
{ key: "Mod-.", pre: "<sup>", post: "</sup>", desc: "sup" },
|
|
4
|
+
{ key: "Mod-,", pre: "<sub>", post: "</sub>", desc: "sub" },
|
|
5
|
+
{ key: "Mod-Shift-6", pre: "<code>", post: "</code>", desc: "code" },
|
|
6
|
+
{ key: "Ctrl-Shift-5", pre: "<s>", post: "</s>", desc: "s" },
|
|
7
|
+
{ key: "Mod-u", pre: "<u>", post: "</u>", desc: "u" },
|
|
8
|
+
{ key: "Mod-k", pre: "[[", post: "]]", desc: "link" },
|
|
9
|
+
{ key: "Mod-i", pre: "''", post: "''", desc: "italic" },
|
|
10
|
+
{ key: "Mod-b", pre: "'''", post: "'''", desc: "bold" },
|
|
11
|
+
{ key: "Mod-Shift-k", pre: "<ref>", post: "</ref>", desc: "ref" },
|
|
12
|
+
{ key: "Mod-/", pre: "<!-- ", post: " -->", desc: "comment" },
|
|
13
|
+
{ key: "Ctrl-0", splitlines: true, desc: "heading 0" },
|
|
14
|
+
...new Array(6).fill(0).map((_, i) => ({
|
|
15
|
+
key: `Ctrl-${i + 1}`,
|
|
16
|
+
pre: `${"=".repeat(i + 1)} `,
|
|
17
|
+
post: ` ${"=".repeat(i + 1)}`,
|
|
18
|
+
splitlines: true,
|
|
19
|
+
desc: `heading ${i + 1}`
|
|
20
|
+
})),
|
|
21
|
+
{ key: "Ctrl-7", pre: " ", splitlines: true, desc: "pre" }
|
|
22
|
+
];
|
|
23
|
+
const encapsulateLines = (text, pre, post) => {
|
|
24
|
+
const lines = text.split("\n");
|
|
25
|
+
return lines.map((line) => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const str = ((_b = (_a = /^(={1,6})(.+)\1$/u.exec(line)) == null ? void 0 : _a[2]) != null ? _b : line).trim();
|
|
28
|
+
return pre === " " || lines.length === 1 || line.trim() ? pre + str + post : str;
|
|
29
|
+
}).join("\n");
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
encapsulateLines,
|
|
33
|
+
keybindings
|
|
34
|
+
};
|
package/dist/lua.d.ts
ADDED