@bhsd/codemirror-mediawiki 2.14.0 → 2.14.2
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 -4
- package/dist/config.d.ts +3 -0
- package/dist/main.min.js +13 -13
- package/dist/mw.min.js +13 -13
- package/dist/token.d.ts +16 -8
- package/i18n/en.json +1 -1
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/mediawiki.css +9 -0
- package/package.json +1 -1
package/dist/token.d.ts
CHANGED
|
@@ -21,15 +21,17 @@ declare const tokens: {
|
|
|
21
21
|
extLinkText: string;
|
|
22
22
|
extTag: string;
|
|
23
23
|
extTagAttribute: string;
|
|
24
|
+
extTagAttributeValue: string;
|
|
24
25
|
extTagBracket: string;
|
|
25
26
|
extTagName: string;
|
|
26
27
|
fileText: string;
|
|
27
28
|
freeExtLink: string;
|
|
28
29
|
freeExtLinkProtocol: string;
|
|
29
|
-
/** 已解析的节点 */
|
|
30
30
|
hr: string;
|
|
31
|
+
/** 当前起始位置 */
|
|
31
32
|
htmlEntity: string;
|
|
32
33
|
htmlTagAttribute: string;
|
|
34
|
+
htmlTagAttributeValue: string;
|
|
33
35
|
htmlTagBracket: string;
|
|
34
36
|
htmlTagName: string;
|
|
35
37
|
imageParameter: string;
|
|
@@ -52,8 +54,14 @@ declare const tokens: {
|
|
|
52
54
|
skipFormatting: string;
|
|
53
55
|
strong: string;
|
|
54
56
|
tableBracket: string;
|
|
57
|
+
/**
|
|
58
|
+
* 浅复制嵌套状态
|
|
59
|
+
* @param a
|
|
60
|
+
* @param b
|
|
61
|
+
*/
|
|
55
62
|
tableCaption: string;
|
|
56
63
|
tableDefinition: string;
|
|
64
|
+
tableDefinitionValue: string;
|
|
57
65
|
tableDelimiter: string;
|
|
58
66
|
tableDelimiter2: string;
|
|
59
67
|
tableTd: string;
|
|
@@ -72,7 +80,6 @@ declare type Style = string | [string];
|
|
|
72
80
|
declare type Tokenizer<T = Style> = ((stream: StringStream, state: State) => T) & {
|
|
73
81
|
args?: unknown[];
|
|
74
82
|
};
|
|
75
|
-
declare type TagName = keyof typeof tokens;
|
|
76
83
|
declare type NestCount = 'nTemplate' | 'nExt' | 'nVar' | 'nLink' | 'nExtLink';
|
|
77
84
|
declare interface Nesting extends Record<NestCount, number> {
|
|
78
85
|
extName: string | false;
|
|
@@ -88,6 +95,7 @@ declare interface State extends Nesting {
|
|
|
88
95
|
italic: boolean;
|
|
89
96
|
dt: Partial<Nesting> & {
|
|
90
97
|
n: number;
|
|
98
|
+
html: number;
|
|
91
99
|
};
|
|
92
100
|
redirect: boolean;
|
|
93
101
|
data: MediaWikiData;
|
|
@@ -99,6 +107,7 @@ declare interface Token {
|
|
|
99
107
|
style: Style;
|
|
100
108
|
readonly state: State;
|
|
101
109
|
}
|
|
110
|
+
export type TagName = keyof typeof tokens;
|
|
102
111
|
export type ApiSuggestions = [string, string?][];
|
|
103
112
|
/**
|
|
104
113
|
* 获取维基链接建议
|
|
@@ -146,19 +155,18 @@ export declare class MediaWiki {
|
|
|
146
155
|
readonly implicitlyClosedHtmlTags: Set<string>;
|
|
147
156
|
readonly urlProtocols: RegExp;
|
|
148
157
|
readonly linkRegex: RegExp;
|
|
149
|
-
readonly inLinkRegex: RegExp;
|
|
150
158
|
readonly fileRegex: RegExp;
|
|
151
159
|
readonly redirectRegex: RegExp;
|
|
152
160
|
readonly img: string[];
|
|
153
161
|
readonly imgRegex: RegExp;
|
|
154
162
|
readonly headerRegex: RegExp;
|
|
155
|
-
readonly extAttrRegex: RegExp;
|
|
156
163
|
readonly templateRegex: RegExp;
|
|
157
164
|
readonly argumentRegex: RegExp;
|
|
158
165
|
readonly convertSemicolon: RegExp;
|
|
159
166
|
readonly convertLang: RegExp;
|
|
160
167
|
readonly convertRegex: RegExp;
|
|
161
|
-
readonly
|
|
168
|
+
readonly wikiRegex: RegExp;
|
|
169
|
+
readonly tableDefinitionRegex: RegExp;
|
|
162
170
|
readonly tags: string[];
|
|
163
171
|
constructor(config: MwConfig);
|
|
164
172
|
/**
|
|
@@ -193,14 +201,14 @@ export declare class MediaWiki {
|
|
|
193
201
|
eatList(stream: StringStream, state: State): string;
|
|
194
202
|
eatDoubleUnderscore(style: string, stream: StringStream, state: State): Style;
|
|
195
203
|
get eatStartTable(): Tokenizer;
|
|
196
|
-
inTableDefinition(tr?: boolean): Tokenizer;
|
|
204
|
+
inTableDefinition(tr?: boolean, quote?: string): Tokenizer;
|
|
197
205
|
get inTable(): Tokenizer;
|
|
198
206
|
inTableCell(style: string, needAttr?: boolean, firstLine?: boolean): Tokenizer;
|
|
199
207
|
inSectionHeader(str: string): Tokenizer;
|
|
200
208
|
get inComment(): Tokenizer;
|
|
201
209
|
eatTagName(name: string, isCloseTag?: boolean, isHtmlTag?: boolean): Tokenizer;
|
|
202
|
-
inHtmlTagAttribute(name: string): Tokenizer;
|
|
203
|
-
inExtTagAttribute(name: string): Tokenizer;
|
|
210
|
+
inHtmlTagAttribute(name: string, quote?: string): Tokenizer;
|
|
211
|
+
inExtTagAttribute(name: string, quote?: string): Tokenizer;
|
|
204
212
|
eatExtTagArea(name: string): Tokenizer;
|
|
205
213
|
inExtTokens(origString: string): Tokenizer;
|
|
206
214
|
inVariable(pos?: number): Tokenizer;
|
package/i18n/en.json
CHANGED
package/i18n/zh-hans.json
CHANGED
package/i18n/zh-hant.json
CHANGED
package/mediawiki.css
CHANGED
|
@@ -183,6 +183,11 @@
|
|
|
183
183
|
color: #14866d;
|
|
184
184
|
font-weight: normal;
|
|
185
185
|
}
|
|
186
|
+
.cm-mw-exttag-attribute-value,
|
|
187
|
+
.cm-mw-htmltag-attribute-value {
|
|
188
|
+
color: #179b1c;
|
|
189
|
+
font-weight: normal;
|
|
190
|
+
}
|
|
186
191
|
|
|
187
192
|
/* table */
|
|
188
193
|
.cm-mw-table-bracket,
|
|
@@ -195,6 +200,10 @@
|
|
|
195
200
|
color: #d08;
|
|
196
201
|
font-weight: normal;
|
|
197
202
|
}
|
|
203
|
+
.cm-mw-table-definition-value {
|
|
204
|
+
color: #f500d4;
|
|
205
|
+
font-weight: normal;
|
|
206
|
+
}
|
|
198
207
|
.cm-mw-table-th,
|
|
199
208
|
.cm-mw-table-caption {
|
|
200
209
|
font-weight: bold;
|