@bhsd/codemirror-mediawiki 2.14.4 → 2.14.6
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 +1 -1
- package/dist/bidi.d.ts +14 -0
- package/dist/main.min.js +26 -16
- package/dist/matchTag.d.ts +6 -0
- package/dist/mediawiki.d.ts +1 -1
- package/dist/mw.min.js +30 -20
- package/dist/token.d.ts +3 -24
- package/i18n/en.json +1 -1
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/mediawiki.css +8 -0
- package/package.json +2 -2
package/dist/token.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author pastakhov, MusikAnimal and others
|
|
2
|
+
* @author pastakhov, MusikAnimal, Bhsd and others
|
|
3
3
|
* @license GPL-2.0-or-later
|
|
4
4
|
* @see https://gerrit.wikimedia.org/g/mediawiki/extensions/CodeMirror
|
|
5
5
|
*/
|
|
@@ -28,7 +28,6 @@ declare const tokens: {
|
|
|
28
28
|
freeExtLink: string;
|
|
29
29
|
freeExtLinkProtocol: string;
|
|
30
30
|
hr: string;
|
|
31
|
-
/** 当前起始位置 */
|
|
32
31
|
htmlEntity: string;
|
|
33
32
|
htmlTagAttribute: string;
|
|
34
33
|
htmlTagAttributeValue: string;
|
|
@@ -54,11 +53,6 @@ declare const tokens: {
|
|
|
54
53
|
skipFormatting: string;
|
|
55
54
|
strong: string;
|
|
56
55
|
tableBracket: string;
|
|
57
|
-
/**
|
|
58
|
-
* 浅复制嵌套状态
|
|
59
|
-
* @param a
|
|
60
|
-
* @param b
|
|
61
|
-
*/
|
|
62
56
|
tableCaption: string;
|
|
63
57
|
tableDefinition: string;
|
|
64
58
|
tableDefinitionValue: string;
|
|
@@ -100,7 +94,6 @@ declare interface State extends Nesting {
|
|
|
100
94
|
redirect: boolean;
|
|
101
95
|
data: MediaWikiData;
|
|
102
96
|
}
|
|
103
|
-
declare type ExtState = Omit<State, 'dt'> & Partial<Pick<State, 'dt'>>;
|
|
104
97
|
declare interface Token {
|
|
105
98
|
pos: number;
|
|
106
99
|
readonly string: string;
|
|
@@ -181,14 +174,9 @@ export declare class MediaWiki {
|
|
|
181
174
|
/**
|
|
182
175
|
* Register the ground tokens. These aren't referenced directly in the StreamParser, nor do
|
|
183
176
|
* they have a parent Tag, so we don't need them as constants like we do for other tokens.
|
|
184
|
-
* See
|
|
177
|
+
* See makeLocalStyle() for how these tokens are used.
|
|
185
178
|
*/
|
|
186
179
|
registerGroundTokens(): void;
|
|
187
|
-
makeFullStyle(style: Style, state: ExtState): string;
|
|
188
|
-
makeTagStyle(tag: TagName, state: State, endGround?: NestCount): [string];
|
|
189
|
-
makeStyle(style: string, state: ExtState, endGround?: NestCount): [string];
|
|
190
|
-
makeLocalTagStyle(tag: TagName, state: State, endGround?: NestCount): string;
|
|
191
|
-
makeLocalStyle(style: string, state: ExtState, endGround?: NestCount): string;
|
|
192
180
|
inStr(str: string, tag: TagName | false, errorTag?: TagName): Tokenizer;
|
|
193
181
|
eatWikiText(style: string): Tokenizer;
|
|
194
182
|
eatApostrophes(obj: Pick<State, 'bold' | 'italic'>): Tokenizer<string | false>;
|
|
@@ -208,7 +196,7 @@ export declare class MediaWiki {
|
|
|
208
196
|
get inComment(): Tokenizer;
|
|
209
197
|
eatTagName(name: string, isCloseTag?: boolean, isHtmlTag?: boolean): Tokenizer;
|
|
210
198
|
inHtmlTagAttribute(name: string, quote?: string): Tokenizer;
|
|
211
|
-
inExtTagAttribute(name: string, quote?: string): Tokenizer;
|
|
199
|
+
inExtTagAttribute(name: string, quote?: string, isLang?: boolean): Tokenizer;
|
|
212
200
|
eatExtTagArea(name: string): Tokenizer;
|
|
213
201
|
inExtTokens(origString: string): Tokenizer;
|
|
214
202
|
inVariable(pos?: number): Tokenizer;
|
|
@@ -219,15 +207,6 @@ export declare class MediaWiki {
|
|
|
219
207
|
inTemplateArgument(expectName?: boolean): Tokenizer;
|
|
220
208
|
inConvert(style: string, needFlag?: boolean, needLang?: boolean): Tokenizer;
|
|
221
209
|
eatEntity(stream: StringStream, style: string): string;
|
|
222
|
-
/**
|
|
223
|
-
* Remembers position and status for rollbacking.
|
|
224
|
-
* It is needed for changing from bold to italic with apostrophes before it, if required.
|
|
225
|
-
*
|
|
226
|
-
* @see https://phabricator.wikimedia.org/T108455
|
|
227
|
-
* @param stream
|
|
228
|
-
* @param state
|
|
229
|
-
*/
|
|
230
|
-
prepareItalicForCorrection(stream: StringStream, state: State): void;
|
|
231
210
|
/**
|
|
232
211
|
* main entry
|
|
233
212
|
*
|
package/i18n/en.json
CHANGED
package/i18n/zh-hans.json
CHANGED
package/i18n/zh-hant.json
CHANGED
package/mediawiki.css
CHANGED
|
@@ -37,6 +37,11 @@
|
|
|
37
37
|
.wikiEditor-ui-toolbar {
|
|
38
38
|
z-index: 7;
|
|
39
39
|
}
|
|
40
|
+
.cm-bidi-isolate {
|
|
41
|
+
direction: ltr;
|
|
42
|
+
unicode-bidi: isolate;
|
|
43
|
+
display: inline-block;
|
|
44
|
+
}
|
|
40
45
|
|
|
41
46
|
/**
|
|
42
47
|
* @author pastakhov and others
|
|
@@ -113,6 +118,9 @@
|
|
|
113
118
|
color: #80c;
|
|
114
119
|
font-weight: bold;
|
|
115
120
|
}
|
|
121
|
+
.cm-editor[dir="rtl"] .cm-mw-template-name {
|
|
122
|
+
unicode-bidi: isolate;
|
|
123
|
+
}
|
|
116
124
|
.cm-mw-template-argument-name {
|
|
117
125
|
color: #b0c;
|
|
118
126
|
font-weight: normal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bhsd/codemirror-mediawiki",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.6",
|
|
4
4
|
"description": "Modified CodeMirror mode based on wikimedia/mediawiki-extensions-CodeMirror",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@codemirror/language": "^6.10.1",
|
|
51
51
|
"@codemirror/lint": "^6.8.0",
|
|
52
52
|
"@codemirror/state": "^6.4.1",
|
|
53
|
-
"@codemirror/view": "^6.
|
|
53
|
+
"@codemirror/view": "^6.26.4",
|
|
54
54
|
"@lezer/common": "^1.2.1",
|
|
55
55
|
"wikiparser-node": "^1.9.0"
|
|
56
56
|
},
|