@bhsd/codemirror-mediawiki 2.25.5 → 2.26.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 +31 -7
- package/dist/bidi.d.ts +2 -1
- package/dist/color.d.ts +4 -1
- package/dist/config.d.ts +1 -0
- package/dist/fold.d.ts +9 -1
- package/dist/main.min.js +16 -16
- package/dist/mw.min.js +20 -20
- package/dist/openLinks.d.ts +3 -0
- package/dist/token.d.ts +4 -2
- package/dist/wiki.min.js +20 -20
- 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 +8 -11
package/README.md
CHANGED
|
@@ -583,11 +583,35 @@ CTRL/CMD-click opens a link in a new tab.
|
|
|
583
583
|
|
|
584
584
|
## Syntax Highlighting
|
|
585
585
|
|
|
586
|
-
|
|
586
|
+
### Extension
|
|
587
|
+
|
|
587
588
|
1. [Extension:Translate](https://www.mediawiki.org/wiki/Extension:Translate) is not supported.
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
1.
|
|
592
|
-
1.
|
|
593
|
-
1.
|
|
589
|
+
|
|
590
|
+
### Transclusion
|
|
591
|
+
|
|
592
|
+
1. Non-existing parser functions starting with `#` are highlighted ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Parsoid%3A%20unknown%20parser%20function%20(T314524))).
|
|
593
|
+
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
|
+
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
|
+
|
|
596
|
+
### Heading
|
|
597
|
+
|
|
598
|
+
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))).
|
|
599
|
+
|
|
600
|
+
### Table
|
|
601
|
+
|
|
602
|
+
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)).
|
|
603
|
+
|
|
604
|
+
### Link
|
|
605
|
+
|
|
606
|
+
1. Nested double brackets are highlighted incorrectly ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Non-wikilinks%20should%20not%20be%20treated%20as%20broken%20wikilinks)).
|
|
607
|
+
1. Double URI encoding should not appear in link targets ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Link%20containing%20%25%20as%20a%20double%20hex%20sequence%20interpreted%20to%20hex%20sequence)).
|
|
608
|
+
1. Double HTML escaping should not appear in link targets ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Link%20containing%20an%20ampersand)).
|
|
609
|
+
|
|
610
|
+
### External link
|
|
611
|
+
|
|
612
|
+
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))).
|
|
613
|
+
|
|
614
|
+
### Block element
|
|
615
|
+
|
|
616
|
+
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)).
|
|
617
|
+
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/bidi.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* @license GPL-2.0-or-later
|
|
4
4
|
* @see https://gerrit.wikimedia.org/g/mediawiki/extensions/CodeMirror
|
|
5
5
|
*/
|
|
6
|
-
import { Direction, ViewPlugin } from '@codemirror/view';
|
|
6
|
+
import { EditorView, Direction, ViewPlugin } from '@codemirror/view';
|
|
7
7
|
import type { ViewUpdate, DecorationSet } from '@codemirror/view';
|
|
8
|
+
export declare const computeIsolates: ({ visibleRanges, state, textDirection }: EditorView) => DecorationSet;
|
|
8
9
|
declare const _default: ViewPlugin<{
|
|
9
10
|
isolates: DecorationSet;
|
|
10
11
|
tree: import("@lezer/common").Tree;
|
package/dist/color.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type { Extension } from '@codemirror/state';
|
|
1
|
+
import type { Text, Extension } from '@codemirror/state';
|
|
2
|
+
import type { Tree } from '@lezer/common';
|
|
2
3
|
import type { StyleSpec } from 'style-mod';
|
|
4
|
+
import type { WidgetOptions } from '@bhsd/codemirror-css-color-picker';
|
|
5
|
+
export declare const discoverColors: (_: Tree, from: number, to: number, type: string, doc: Text) => WidgetOptions[] | null;
|
|
3
6
|
declare const _default: [([e, style]?: [Extension?, StyleSpec?]) => Extension, {
|
|
4
7
|
css: [Extension];
|
|
5
8
|
mediawiki: [Extension[], {
|
package/dist/config.d.ts
CHANGED
package/dist/fold.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StateField } from '@codemirror/state';
|
|
2
2
|
import type { EditorView, Tooltip } from '@codemirror/view';
|
|
3
3
|
import type { EditorState, Extension } from '@codemirror/state';
|
|
4
|
-
import type { SyntaxNode } from '@lezer/common';
|
|
4
|
+
import type { SyntaxNode, Tree } from '@lezer/common';
|
|
5
5
|
export interface DocRange {
|
|
6
6
|
from: number;
|
|
7
7
|
to: number;
|
|
@@ -12,6 +12,14 @@ export interface DocRange {
|
|
|
12
12
|
* @param node 语法树节点
|
|
13
13
|
*/
|
|
14
14
|
export declare const braceStackUpdate: (state: EditorState, node: SyntaxNode) => [number, number];
|
|
15
|
+
/**
|
|
16
|
+
* 寻找可折叠的范围
|
|
17
|
+
* @param state
|
|
18
|
+
* @param posOrNode 字符位置或语法树节点
|
|
19
|
+
* @param tree 语法树
|
|
20
|
+
*/
|
|
21
|
+
export declare const foldable: (state: EditorState, posOrNode: number | SyntaxNode, tree?: Tree | null) => DocRange | false;
|
|
22
|
+
export declare const foldableLine: ({ state, viewport: { to: end }, viewportLineBlocks }: EditorView, { from: f, to: t }: DocRange) => DocRange | false;
|
|
15
23
|
declare const _default: [(e?: Extension | undefined) => Extension, {
|
|
16
24
|
lua: Extension[];
|
|
17
25
|
mediawiki: (Extension | StateField<Tooltip | null>)[];
|