@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 CHANGED
@@ -583,11 +583,35 @@ CTRL/CMD-click opens a link in a new tab.
583
583
 
584
584
  ## Syntax Highlighting
585
585
 
586
- 1. Preformatted text with a leading space may have false positives.
586
+ ### Extension
587
+
587
588
  1. [Extension:Translate](https://www.mediawiki.org/wiki/Extension:Translate) is not supported.
588
- 1. Template parameter name followed by a newline ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Templates%3A%20Handle%20comments%20in%20parameter%20names%20(T69657))).
589
- 1. Wikitext in template parameter names ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Templates%3A%20Other%20wikitext%20in%20parameter%20names%20(T69657))).
590
- 1. Double URI encoding 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)).
591
- 1. Double HTML escaping in link targets ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Link%20containing%20an%20ampersand)).
592
- 1. Comments at the start of a line ([Example](https://bhsd-harry.github.io/codemirror-mediawiki/tests.html#1.%20Lists%20with%20start-of-line-transparent%20tokens%20before%20bullets%3A%20Comments)).
593
- 1. External link inside double brackets ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
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
@@ -43,6 +43,7 @@ tokens: {
43
43
  extTagAttributeValue: string;
44
44
  extTagBracket: string;
45
45
  extTagName: string;
46
+ fileDelimiter: string;
46
47
  fileText: string;
47
48
  freeExtLink: string;
48
49
  freeExtLinkProtocol: string;
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>)[];