@khanacademy/pure-markdown 2.3.0 → 2.3.1
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/es/index.js +1 -1
- package/dist/index.d.ts +9 -46
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-utils';
|
|
2
2
|
import SimpleMarkdown from '@khanacademy/simple-markdown';
|
|
3
3
|
|
|
4
|
-
const libName="@khanacademy/pure-markdown";const libVersion="2.3.
|
|
4
|
+
const libName="@khanacademy/pure-markdown";const libVersion="2.3.1";addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
5
5
|
|
|
6
6
|
const traverseContent=(ast,cb)=>{if(Array.isArray(ast)){ast.forEach(node=>traverseContent(node,cb));}else if(typeof ast==="object"&&ast!==null){cb(ast);if(ast.type==="table"){traverseContent(ast.header,cb);traverseContent(ast.cells,cb);}else if(ast.type==="list"){traverseContent(ast.items,cb);}else if(ast.type==="titledTable"){traverseContent(ast.table,cb);}else if(ast.type==="columns"){traverseContent(ast.col1,cb);traverseContent(ast.col2,cb);}else if(Array.isArray(ast.content)){traverseContent(ast.content,cb);}}};
|
|
7
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,6 @@ export declare const pureMarkdownRules: {
|
|
|
48
48
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
49
49
|
readonly quality?: (capture: import("@khanacademy/simple-markdown").Capture, state: import("@khanacademy/simple-markdown").State, prevCapture: string) => number;
|
|
50
50
|
readonly react: import("@khanacademy/simple-markdown").ReactNodeOutput | null;
|
|
51
|
-
readonly html: ((node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string) | null;
|
|
52
51
|
};
|
|
53
52
|
readonly blockQuote: {
|
|
54
53
|
readonly match: any;
|
|
@@ -58,7 +57,6 @@ export declare const pureMarkdownRules: {
|
|
|
58
57
|
[key: string]: any;
|
|
59
58
|
};
|
|
60
59
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
61
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
62
60
|
};
|
|
63
61
|
readonly lint: {
|
|
64
62
|
readonly order: 1000;
|
|
@@ -67,7 +65,6 @@ export declare const pureMarkdownRules: {
|
|
|
67
65
|
};
|
|
68
66
|
readonly Array: {
|
|
69
67
|
readonly react: import("@khanacademy/simple-markdown").ArrayNodeOutput<import("react").ReactNode>;
|
|
70
|
-
readonly html: import("@khanacademy/simple-markdown").ArrayNodeOutput<string>;
|
|
71
68
|
};
|
|
72
69
|
readonly heading: {
|
|
73
70
|
readonly order: number;
|
|
@@ -78,8 +75,6 @@ export declare const pureMarkdownRules: {
|
|
|
78
75
|
};
|
|
79
76
|
} & {
|
|
80
77
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
81
|
-
} & {
|
|
82
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
83
78
|
};
|
|
84
79
|
readonly nptable: {
|
|
85
80
|
readonly order: number;
|
|
@@ -88,7 +83,7 @@ export declare const pureMarkdownRules: {
|
|
|
88
83
|
readonly parse: (capture: import("@khanacademy/simple-markdown").Capture, nestedParse: import("@khanacademy/simple-markdown").Parser, state: import("@khanacademy/simple-markdown").State) => {
|
|
89
84
|
[key: string]: any;
|
|
90
85
|
};
|
|
91
|
-
} & import("@khanacademy/simple-markdown").ReactOutputRule
|
|
86
|
+
} & import("@khanacademy/simple-markdown").ReactOutputRule;
|
|
92
87
|
readonly lheading: {
|
|
93
88
|
readonly order: number;
|
|
94
89
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
@@ -96,7 +91,7 @@ export declare const pureMarkdownRules: {
|
|
|
96
91
|
readonly parse: (capture: import("@khanacademy/simple-markdown").Capture, nestedParse: import("@khanacademy/simple-markdown").Parser, state: import("@khanacademy/simple-markdown").State) => {
|
|
97
92
|
[key: string]: any;
|
|
98
93
|
};
|
|
99
|
-
} & import("@khanacademy/simple-markdown").ReactOutputRule
|
|
94
|
+
} & import("@khanacademy/simple-markdown").ReactOutputRule;
|
|
100
95
|
readonly hr: {
|
|
101
96
|
readonly order: number;
|
|
102
97
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
@@ -106,8 +101,6 @@ export declare const pureMarkdownRules: {
|
|
|
106
101
|
};
|
|
107
102
|
} & {
|
|
108
103
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
109
|
-
} & {
|
|
110
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
111
104
|
};
|
|
112
105
|
readonly codeBlock: {
|
|
113
106
|
readonly order: number;
|
|
@@ -118,8 +111,6 @@ export declare const pureMarkdownRules: {
|
|
|
118
111
|
};
|
|
119
112
|
} & {
|
|
120
113
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
121
|
-
} & {
|
|
122
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
123
114
|
};
|
|
124
115
|
readonly list: {
|
|
125
116
|
readonly order: number;
|
|
@@ -130,8 +121,6 @@ export declare const pureMarkdownRules: {
|
|
|
130
121
|
};
|
|
131
122
|
} & {
|
|
132
123
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
133
|
-
} & {
|
|
134
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
135
124
|
};
|
|
136
125
|
readonly def: {
|
|
137
126
|
readonly order: number;
|
|
@@ -142,8 +131,6 @@ export declare const pureMarkdownRules: {
|
|
|
142
131
|
};
|
|
143
132
|
} & {
|
|
144
133
|
readonly react: import("@khanacademy/simple-markdown").ReactNodeOutput;
|
|
145
|
-
} & {
|
|
146
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
147
134
|
};
|
|
148
135
|
readonly table: {
|
|
149
136
|
readonly order: number;
|
|
@@ -154,8 +141,6 @@ export declare const pureMarkdownRules: {
|
|
|
154
141
|
};
|
|
155
142
|
} & {
|
|
156
143
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
157
|
-
} & {
|
|
158
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
159
144
|
};
|
|
160
145
|
readonly tableSeparator: {
|
|
161
146
|
readonly order: number;
|
|
@@ -164,7 +149,7 @@ export declare const pureMarkdownRules: {
|
|
|
164
149
|
readonly parse: (capture: import("@khanacademy/simple-markdown").Capture, nestedParse: import("@khanacademy/simple-markdown").Parser, state: import("@khanacademy/simple-markdown").State) => {
|
|
165
150
|
[key: string]: any;
|
|
166
151
|
};
|
|
167
|
-
} & import("@khanacademy/simple-markdown").ReactOutputRule
|
|
152
|
+
} & import("@khanacademy/simple-markdown").ReactOutputRule;
|
|
168
153
|
readonly newline: {
|
|
169
154
|
readonly order: number;
|
|
170
155
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
@@ -174,8 +159,6 @@ export declare const pureMarkdownRules: {
|
|
|
174
159
|
};
|
|
175
160
|
} & {
|
|
176
161
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<string>;
|
|
177
|
-
} & {
|
|
178
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
179
162
|
};
|
|
180
163
|
readonly paragraph: {
|
|
181
164
|
readonly order: number;
|
|
@@ -186,8 +169,6 @@ export declare const pureMarkdownRules: {
|
|
|
186
169
|
};
|
|
187
170
|
} & {
|
|
188
171
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
189
|
-
} & {
|
|
190
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
191
172
|
};
|
|
192
173
|
readonly escape: {
|
|
193
174
|
readonly order: number;
|
|
@@ -196,7 +177,7 @@ export declare const pureMarkdownRules: {
|
|
|
196
177
|
readonly parse: (capture: import("@khanacademy/simple-markdown").Capture, nestedParse: import("@khanacademy/simple-markdown").Parser, state: import("@khanacademy/simple-markdown").State) => {
|
|
197
178
|
[key: string]: any;
|
|
198
179
|
};
|
|
199
|
-
} & import("@khanacademy/simple-markdown").ReactOutputRule
|
|
180
|
+
} & import("@khanacademy/simple-markdown").ReactOutputRule;
|
|
200
181
|
readonly autolink: {
|
|
201
182
|
readonly order: number;
|
|
202
183
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
@@ -204,7 +185,7 @@ export declare const pureMarkdownRules: {
|
|
|
204
185
|
readonly parse: (capture: import("@khanacademy/simple-markdown").Capture, nestedParse: import("@khanacademy/simple-markdown").Parser, state: import("@khanacademy/simple-markdown").State) => {
|
|
205
186
|
[key: string]: any;
|
|
206
187
|
};
|
|
207
|
-
} & import("@khanacademy/simple-markdown").ReactOutputRule
|
|
188
|
+
} & import("@khanacademy/simple-markdown").ReactOutputRule;
|
|
208
189
|
readonly mailto: {
|
|
209
190
|
readonly order: number;
|
|
210
191
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
@@ -212,7 +193,7 @@ export declare const pureMarkdownRules: {
|
|
|
212
193
|
readonly parse: (capture: import("@khanacademy/simple-markdown").Capture, nestedParse: import("@khanacademy/simple-markdown").Parser, state: import("@khanacademy/simple-markdown").State) => {
|
|
213
194
|
[key: string]: any;
|
|
214
195
|
};
|
|
215
|
-
} & import("@khanacademy/simple-markdown").ReactOutputRule
|
|
196
|
+
} & import("@khanacademy/simple-markdown").ReactOutputRule;
|
|
216
197
|
readonly url: {
|
|
217
198
|
readonly order: number;
|
|
218
199
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
@@ -220,7 +201,7 @@ export declare const pureMarkdownRules: {
|
|
|
220
201
|
readonly parse: (capture: import("@khanacademy/simple-markdown").Capture, nestedParse: import("@khanacademy/simple-markdown").Parser, state: import("@khanacademy/simple-markdown").State) => {
|
|
221
202
|
[key: string]: any;
|
|
222
203
|
};
|
|
223
|
-
} & import("@khanacademy/simple-markdown").ReactOutputRule
|
|
204
|
+
} & import("@khanacademy/simple-markdown").ReactOutputRule;
|
|
224
205
|
readonly link: {
|
|
225
206
|
readonly order: number;
|
|
226
207
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
@@ -230,8 +211,6 @@ export declare const pureMarkdownRules: {
|
|
|
230
211
|
};
|
|
231
212
|
} & {
|
|
232
213
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
233
|
-
} & {
|
|
234
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
235
214
|
};
|
|
236
215
|
readonly image: {
|
|
237
216
|
readonly order: number;
|
|
@@ -242,8 +221,6 @@ export declare const pureMarkdownRules: {
|
|
|
242
221
|
};
|
|
243
222
|
} & {
|
|
244
223
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
245
|
-
} & {
|
|
246
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
247
224
|
};
|
|
248
225
|
readonly reflink: {
|
|
249
226
|
readonly order: number;
|
|
@@ -252,7 +229,7 @@ export declare const pureMarkdownRules: {
|
|
|
252
229
|
readonly parse: (capture: import("@khanacademy/simple-markdown").Capture, nestedParse: import("@khanacademy/simple-markdown").Parser, state: import("@khanacademy/simple-markdown").State) => {
|
|
253
230
|
[key: string]: any;
|
|
254
231
|
};
|
|
255
|
-
} & import("@khanacademy/simple-markdown").ReactOutputRule
|
|
232
|
+
} & import("@khanacademy/simple-markdown").ReactOutputRule;
|
|
256
233
|
readonly refimage: {
|
|
257
234
|
readonly order: number;
|
|
258
235
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
@@ -260,7 +237,7 @@ export declare const pureMarkdownRules: {
|
|
|
260
237
|
readonly parse: (capture: import("@khanacademy/simple-markdown").Capture, nestedParse: import("@khanacademy/simple-markdown").Parser, state: import("@khanacademy/simple-markdown").State) => {
|
|
261
238
|
[key: string]: any;
|
|
262
239
|
};
|
|
263
|
-
} & import("@khanacademy/simple-markdown").ReactOutputRule
|
|
240
|
+
} & import("@khanacademy/simple-markdown").ReactOutputRule;
|
|
264
241
|
readonly em: {
|
|
265
242
|
readonly order: number;
|
|
266
243
|
readonly match: import("@khanacademy/simple-markdown").MatchFunction;
|
|
@@ -270,8 +247,6 @@ export declare const pureMarkdownRules: {
|
|
|
270
247
|
};
|
|
271
248
|
} & {
|
|
272
249
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
273
|
-
} & {
|
|
274
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
275
250
|
};
|
|
276
251
|
readonly strong: {
|
|
277
252
|
readonly order: number;
|
|
@@ -282,8 +257,6 @@ export declare const pureMarkdownRules: {
|
|
|
282
257
|
};
|
|
283
258
|
} & {
|
|
284
259
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
285
|
-
} & {
|
|
286
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
287
260
|
};
|
|
288
261
|
readonly u: {
|
|
289
262
|
readonly order: number;
|
|
@@ -294,8 +267,6 @@ export declare const pureMarkdownRules: {
|
|
|
294
267
|
};
|
|
295
268
|
} & {
|
|
296
269
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
297
|
-
} & {
|
|
298
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
299
270
|
};
|
|
300
271
|
readonly del: {
|
|
301
272
|
readonly order: number;
|
|
@@ -306,8 +277,6 @@ export declare const pureMarkdownRules: {
|
|
|
306
277
|
};
|
|
307
278
|
} & {
|
|
308
279
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
309
|
-
} & {
|
|
310
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
311
280
|
};
|
|
312
281
|
readonly inlineCode: {
|
|
313
282
|
readonly order: number;
|
|
@@ -318,8 +287,6 @@ export declare const pureMarkdownRules: {
|
|
|
318
287
|
};
|
|
319
288
|
} & {
|
|
320
289
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
321
|
-
} & {
|
|
322
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
323
290
|
};
|
|
324
291
|
readonly br: {
|
|
325
292
|
readonly order: number;
|
|
@@ -330,8 +297,6 @@ export declare const pureMarkdownRules: {
|
|
|
330
297
|
};
|
|
331
298
|
} & {
|
|
332
299
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>>;
|
|
333
|
-
} & {
|
|
334
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
335
300
|
};
|
|
336
301
|
readonly text: {
|
|
337
302
|
readonly order: number;
|
|
@@ -342,8 +307,6 @@ export declare const pureMarkdownRules: {
|
|
|
342
307
|
};
|
|
343
308
|
} & {
|
|
344
309
|
readonly react: import("@khanacademy/simple-markdown").NodeOutput<string>;
|
|
345
|
-
} & {
|
|
346
|
-
readonly html: (node: import("@khanacademy/simple-markdown").SingleASTNode, nestedOutput: import("@khanacademy/simple-markdown").Output<string>, state: import("@khanacademy/simple-markdown").State) => string;
|
|
347
310
|
};
|
|
348
311
|
};
|
|
349
312
|
/**
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
|
|
10
10
|
var SimpleMarkdown__default = /*#__PURE__*/_interopDefaultCompat(SimpleMarkdown);
|
|
11
11
|
|
|
12
|
-
const libName="@khanacademy/pure-markdown";const libVersion="2.3.
|
|
12
|
+
const libName="@khanacademy/pure-markdown";const libVersion="2.3.1";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
13
13
|
|
|
14
14
|
const traverseContent=(ast,cb)=>{if(Array.isArray(ast)){ast.forEach(node=>traverseContent(node,cb));}else if(typeof ast==="object"&&ast!==null){cb(ast);if(ast.type==="table"){traverseContent(ast.header,cb);traverseContent(ast.cells,cb);}else if(ast.type==="list"){traverseContent(ast.items,cb);}else if(ast.type==="titledTable"){traverseContent(ast.table,cb);}else if(ast.type==="columns"){traverseContent(ast.col1,cb);traverseContent(ast.col2,cb);}else if(Array.isArray(ast.content)){traverseContent(ast.content,cb);}}};
|
|
15
15
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "SimpleMarkdown instance with non-react Perseus rules",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "2.3.
|
|
6
|
+
"version": "2.3.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@khanacademy/perseus-utils": "2.1.5",
|
|
26
|
-
"@khanacademy/simple-markdown": "
|
|
26
|
+
"@khanacademy/simple-markdown": "3.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"perseus-build-settings": "0.9.0"
|