pro-editor-schema 0.1.198 → 0.1.199
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/index.d.mts +8 -13
- package/dist/index.d.ts +8 -13
- package/dist/index.js +417 -469
- package/dist/index.mjs +415 -468
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ __export(index_exports, {
|
|
|
30
30
|
IGNORED_ATTRIBUTES: () => IGNORED_ATTRIBUTES,
|
|
31
31
|
IGNORED_ATTRIBUTES_STARTS_WITH: () => IGNORED_ATTRIBUTES_STARTS_WITH,
|
|
32
32
|
IGNORED_ELEMENT_SELECTORS: () => IGNORED_ELEMENT_SELECTORS,
|
|
33
|
+
IGNORED_VALIDATION_ELEMENT_SELECTORS: () => IGNORED_VALIDATION_ELEMENT_SELECTORS,
|
|
33
34
|
INDENT_TYPE_ATTRIBUTE: () => INDENT_TYPE_ATTRIBUTE,
|
|
34
35
|
INLINE_ELEMENT_SCHEMAS: () => INLINE_ELEMENT_SCHEMAS,
|
|
35
36
|
LAYOUT_ATTRIBUTES: () => LAYOUT_ATTRIBUTES,
|
|
@@ -54,11 +55,11 @@ __export(index_exports, {
|
|
|
54
55
|
findAttributeDefinitionByName: () => findAttributeDefinitionByName,
|
|
55
56
|
findSchemaByCode: () => findSchemaByCode,
|
|
56
57
|
findSchemaByElement: () => findSchemaByElement,
|
|
57
|
-
findSchemaByTagName: () => findSchemaByTagName,
|
|
58
58
|
getAttributeName: () => getAttributeName,
|
|
59
59
|
isAttributeRestricted: () => isAttributeRestricted,
|
|
60
60
|
isIgnoredAttribute: () => isIgnoredAttribute,
|
|
61
61
|
isIgnoredElement: () => isIgnoredElement,
|
|
62
|
+
isIgnoredValidation: () => isIgnoredValidation,
|
|
62
63
|
validateXml: () => validateXml
|
|
63
64
|
});
|
|
64
65
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -70,9 +71,8 @@ var createSchema = ({
|
|
|
70
71
|
tag,
|
|
71
72
|
requiredAttributes,
|
|
72
73
|
optionalAttributes,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
forbiddenElements
|
|
74
|
+
defaultChildCode,
|
|
75
|
+
allowedChildrenCodes
|
|
76
76
|
}) => {
|
|
77
77
|
return {
|
|
78
78
|
code,
|
|
@@ -80,9 +80,8 @@ var createSchema = ({
|
|
|
80
80
|
tag,
|
|
81
81
|
requiredAttributes,
|
|
82
82
|
optionalAttributes,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
forbiddenElements: new Set(forbiddenElements)
|
|
83
|
+
defaultChildCode,
|
|
84
|
+
allowedChildrenCodes: new Set(allowedChildrenCodes)
|
|
86
85
|
};
|
|
87
86
|
};
|
|
88
87
|
|
|
@@ -125,6 +124,26 @@ var ELE_ID_ATTRIBUTE = "ele-id";
|
|
|
125
124
|
var STORE_ATTRIBUTE = "store";
|
|
126
125
|
var ID_ATTRS = [STORE_ATTRIBUTE, ELE_ID_ATTRIBUTE];
|
|
127
126
|
|
|
127
|
+
// src/schema/shared/allowedAtomsChildren.ts
|
|
128
|
+
var ATOM_CODES_ALLOWED_CHILDREN = [
|
|
129
|
+
{ code: "indexterm", required: false },
|
|
130
|
+
{ code: "b", required: false },
|
|
131
|
+
{ code: "i", required: false },
|
|
132
|
+
{ code: "u", required: false },
|
|
133
|
+
{ code: "sc", required: false },
|
|
134
|
+
{ code: "emphasis", required: false },
|
|
135
|
+
{ code: "strike", required: false },
|
|
136
|
+
{ code: "sub", required: false },
|
|
137
|
+
{ code: "sup", required: false },
|
|
138
|
+
{ code: "highlightmark", required: false },
|
|
139
|
+
{ code: "insertion", required: false },
|
|
140
|
+
{ code: "deletion", required: false },
|
|
141
|
+
{ code: "commentQuerySection", required: false },
|
|
142
|
+
{ code: "comment", required: false },
|
|
143
|
+
{ code: "query", required: false },
|
|
144
|
+
{ code: "referenceMark", required: false }
|
|
145
|
+
];
|
|
146
|
+
|
|
128
147
|
// src/schema/elementSchemas/atoms/atomTags.ts
|
|
129
148
|
var B_TAG = "B";
|
|
130
149
|
var I_TAG = "I";
|
|
@@ -149,24 +168,6 @@ var BOOKMARK_TAG = "BOOKMARK";
|
|
|
149
168
|
var SEE_TAG = "SEE";
|
|
150
169
|
var REFERENCE_MARK_TAG = "REFERENCE";
|
|
151
170
|
|
|
152
|
-
// src/schema/shared/allowedAtomsChildren.ts
|
|
153
|
-
var ATOM_TAGS_ALLOWED_CHILDREN = [
|
|
154
|
-
{ tagName: INDEXTERM_TAG, required: false },
|
|
155
|
-
{ tagName: B_TAG, required: false },
|
|
156
|
-
{ tagName: I_TAG, required: false },
|
|
157
|
-
{ tagName: U_TAG, required: false },
|
|
158
|
-
{ tagName: SC_TAG, required: false },
|
|
159
|
-
{ tagName: EMPHASIS_TAG, required: false },
|
|
160
|
-
{ tagName: STRIKE_TAG, required: false },
|
|
161
|
-
{ tagName: SUB_TAG, required: false },
|
|
162
|
-
{ tagName: SUP_TAG, required: false },
|
|
163
|
-
{ tagName: HIGHLIGHTMARK_TAG, required: false },
|
|
164
|
-
{ tagName: SPAN_TAG, required: false },
|
|
165
|
-
{ tagName: COMMENT_TAG, required: false },
|
|
166
|
-
{ tagName: QUERY_TAG, required: false },
|
|
167
|
-
{ tagName: REFERENCE_MARK_TAG, required: false }
|
|
168
|
-
];
|
|
169
|
-
|
|
170
171
|
// src/schema/elementSchemas/atoms/b.ts
|
|
171
172
|
var B_SCHEMA = createSchema({
|
|
172
173
|
code: "b",
|
|
@@ -174,7 +175,7 @@ var B_SCHEMA = createSchema({
|
|
|
174
175
|
tag: B_TAG,
|
|
175
176
|
requiredAttributes: [...ID_ATTRS],
|
|
176
177
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
177
|
-
|
|
178
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
178
179
|
});
|
|
179
180
|
|
|
180
181
|
// src/schema/elementSchemas/atoms/commentQuerySection.ts
|
|
@@ -184,23 +185,16 @@ var COMMENT_QUERY_SECTION_SCHEMA = createSchema({
|
|
|
184
185
|
code: "commentQuerySection",
|
|
185
186
|
requiredAttributes: [...ID_ATTRS, "id"],
|
|
186
187
|
optionalAttributes: [...TRACK_CHANGES_ATTRS, "title"],
|
|
187
|
-
|
|
188
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
188
189
|
});
|
|
189
190
|
|
|
190
|
-
// src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
|
|
191
|
-
var FOOTNOTE_LINK_TAG = "FOOTNOTE1";
|
|
192
|
-
var INLINEEQUATION_TAG = "INLINEEQUATION";
|
|
193
|
-
var LINK_TAG = "LINK1";
|
|
194
|
-
var URI_TAG = "URI";
|
|
195
|
-
var PHRASE_TAG = "PHRASE";
|
|
196
|
-
|
|
197
191
|
// src/schema/shared/allowedInlineChildren.ts
|
|
198
|
-
var
|
|
199
|
-
{
|
|
200
|
-
{
|
|
201
|
-
{
|
|
202
|
-
{
|
|
203
|
-
{
|
|
192
|
+
var INLINE_ELEMENT_CODES_ALLOWED_CHILDREN = [
|
|
193
|
+
{ code: "footnote1", required: false },
|
|
194
|
+
{ code: "inlineequation", required: false },
|
|
195
|
+
{ code: "link", required: false },
|
|
196
|
+
{ code: "uri", required: false },
|
|
197
|
+
{ code: "phrase", required: false }
|
|
204
198
|
];
|
|
205
199
|
|
|
206
200
|
// src/schema/elementSchemas/atoms/deletion.ts
|
|
@@ -210,9 +204,9 @@ var DELETION_SCHEMA = createSchema({
|
|
|
210
204
|
tag: SPAN_TAG,
|
|
211
205
|
requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
|
|
212
206
|
optionalAttributes: [],
|
|
213
|
-
|
|
214
|
-
...
|
|
215
|
-
...
|
|
207
|
+
allowedChildrenCodes: [
|
|
208
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
209
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
216
210
|
]
|
|
217
211
|
});
|
|
218
212
|
|
|
@@ -230,7 +224,7 @@ var EMPHASIS_SCHEMA = createSchema({
|
|
|
230
224
|
defaultValue: "lowercase"
|
|
231
225
|
}
|
|
232
226
|
],
|
|
233
|
-
|
|
227
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
234
228
|
});
|
|
235
229
|
|
|
236
230
|
// src/schema/elementSchemas/atoms/highlightmark.ts
|
|
@@ -240,7 +234,7 @@ var HIGHLIGHTMARK_SCHEMA = createSchema({
|
|
|
240
234
|
tag: HIGHLIGHTMARK_TAG,
|
|
241
235
|
requiredAttributes: [...ID_ATTRS],
|
|
242
236
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
243
|
-
|
|
237
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
244
238
|
});
|
|
245
239
|
|
|
246
240
|
// src/schema/elementSchemas/atoms/i.ts
|
|
@@ -250,7 +244,7 @@ var I_SCHEMA = createSchema({
|
|
|
250
244
|
tag: I_TAG,
|
|
251
245
|
requiredAttributes: [...ID_ATTRS],
|
|
252
246
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
253
|
-
|
|
247
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
254
248
|
});
|
|
255
249
|
|
|
256
250
|
// src/schema/elementSchemas/atoms/insertion.ts
|
|
@@ -260,9 +254,9 @@ var INSERTION_SCHEMA = createSchema({
|
|
|
260
254
|
tag: SPAN_TAG,
|
|
261
255
|
requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
|
|
262
256
|
optionalAttributes: [],
|
|
263
|
-
|
|
264
|
-
...
|
|
265
|
-
...
|
|
257
|
+
allowedChildrenCodes: [
|
|
258
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
259
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
266
260
|
]
|
|
267
261
|
});
|
|
268
262
|
|
|
@@ -273,7 +267,7 @@ var SC_SCHEMA = createSchema({
|
|
|
273
267
|
tag: SC_TAG,
|
|
274
268
|
requiredAttributes: [...ID_ATTRS],
|
|
275
269
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
276
|
-
|
|
270
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
277
271
|
});
|
|
278
272
|
|
|
279
273
|
// src/schema/elementSchemas/atoms/strike.ts
|
|
@@ -283,7 +277,7 @@ var STRIKE_SCHEMA = createSchema({
|
|
|
283
277
|
tag: STRIKE_TAG,
|
|
284
278
|
requiredAttributes: [...ID_ATTRS],
|
|
285
279
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
286
|
-
|
|
280
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
287
281
|
});
|
|
288
282
|
|
|
289
283
|
// src/schema/elementSchemas/atoms/sub.ts
|
|
@@ -293,7 +287,7 @@ var SUB_SCHEMA = createSchema({
|
|
|
293
287
|
tag: SUB_TAG,
|
|
294
288
|
requiredAttributes: [...ID_ATTRS],
|
|
295
289
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
296
|
-
|
|
290
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
297
291
|
});
|
|
298
292
|
|
|
299
293
|
// src/schema/elementSchemas/atoms/sup.ts
|
|
@@ -303,7 +297,7 @@ var SUP_SCHEMA = createSchema({
|
|
|
303
297
|
tag: SUP_TAG,
|
|
304
298
|
requiredAttributes: [...ID_ATTRS],
|
|
305
299
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
306
|
-
|
|
300
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
307
301
|
});
|
|
308
302
|
|
|
309
303
|
// src/schema/elementSchemas/atoms/u.ts
|
|
@@ -313,7 +307,7 @@ var U_SCHEMA = createSchema({
|
|
|
313
307
|
tag: U_TAG,
|
|
314
308
|
requiredAttributes: [...ID_ATTRS],
|
|
315
309
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
316
|
-
|
|
310
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
317
311
|
});
|
|
318
312
|
|
|
319
313
|
// src/schema/elementSchemas/atoms/content.ts
|
|
@@ -323,15 +317,15 @@ var CONTENT_SCHEMA = createSchema({
|
|
|
323
317
|
tag: CONTENT_TAG,
|
|
324
318
|
requiredAttributes: [...ID_ATTRS],
|
|
325
319
|
optionalAttributes: [],
|
|
326
|
-
|
|
327
|
-
{
|
|
328
|
-
{
|
|
329
|
-
{
|
|
330
|
-
{
|
|
331
|
-
{
|
|
332
|
-
{
|
|
333
|
-
{
|
|
334
|
-
{
|
|
320
|
+
allowedChildrenCodes: [
|
|
321
|
+
{ code: "b", required: false },
|
|
322
|
+
{ code: "i", required: false },
|
|
323
|
+
{ code: "u", required: false },
|
|
324
|
+
{ code: "sc", required: false },
|
|
325
|
+
{ code: "emphasis", required: false },
|
|
326
|
+
{ code: "strike", required: false },
|
|
327
|
+
{ code: "sub", required: false },
|
|
328
|
+
{ code: "sup", required: false }
|
|
335
329
|
]
|
|
336
330
|
});
|
|
337
331
|
|
|
@@ -352,9 +346,9 @@ var COMMENT_SCHEMA = createSchema({
|
|
|
352
346
|
"markuser",
|
|
353
347
|
"marktime"
|
|
354
348
|
],
|
|
355
|
-
|
|
356
|
-
{
|
|
357
|
-
{
|
|
349
|
+
allowedChildrenCodes: [
|
|
350
|
+
{ code: "content", required: true },
|
|
351
|
+
{ code: "reply", required: false }
|
|
358
352
|
]
|
|
359
353
|
});
|
|
360
354
|
|
|
@@ -375,9 +369,9 @@ var QUERY_SCHEMA = createSchema({
|
|
|
375
369
|
"markuser",
|
|
376
370
|
"marktime"
|
|
377
371
|
],
|
|
378
|
-
|
|
379
|
-
{
|
|
380
|
-
{
|
|
372
|
+
allowedChildrenCodes: [
|
|
373
|
+
{ code: "content", required: true },
|
|
374
|
+
{ code: "reply", required: false }
|
|
381
375
|
]
|
|
382
376
|
});
|
|
383
377
|
|
|
@@ -398,16 +392,16 @@ var REPLY_SCHEMA = createSchema({
|
|
|
398
392
|
"markuser",
|
|
399
393
|
"marktime"
|
|
400
394
|
],
|
|
401
|
-
|
|
395
|
+
allowedChildrenCodes: [{ code: "content", required: true }]
|
|
402
396
|
});
|
|
403
397
|
|
|
404
398
|
// src/schema/elementSchemas/atoms/indexing/indexTermAttributes.ts
|
|
405
399
|
var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
|
|
406
400
|
"data-date",
|
|
407
401
|
"data-user",
|
|
408
|
-
"
|
|
409
|
-
"
|
|
410
|
-
"
|
|
402
|
+
"firstentry",
|
|
403
|
+
"secondentry",
|
|
404
|
+
"thirdentry",
|
|
411
405
|
"entry",
|
|
412
406
|
"linkend",
|
|
413
407
|
...ID_ATTRS
|
|
@@ -420,7 +414,7 @@ var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
|
|
|
420
414
|
var SEE_REQUIRED_ATTRIBUTES = [
|
|
421
415
|
"linkend",
|
|
422
416
|
"data-user",
|
|
423
|
-
"crossref-
|
|
417
|
+
"crossref-pagenumber",
|
|
424
418
|
{
|
|
425
419
|
name: "role",
|
|
426
420
|
values: ["see", "see-also"],
|
|
@@ -428,10 +422,10 @@ var SEE_REQUIRED_ATTRIBUTES = [
|
|
|
428
422
|
},
|
|
429
423
|
...ID_ATTRS,
|
|
430
424
|
"data-date",
|
|
431
|
-
"crossref-
|
|
432
|
-
"crossref-
|
|
433
|
-
"crossref-
|
|
434
|
-
"crossref-
|
|
425
|
+
"crossref-firstentry",
|
|
426
|
+
"crossref-secondentry",
|
|
427
|
+
"crossref-thirdentry",
|
|
428
|
+
"crossref-fourthentry"
|
|
435
429
|
];
|
|
436
430
|
|
|
437
431
|
// src/schema/elementSchemas/atoms/indexing/bookmark.ts
|
|
@@ -444,12 +438,7 @@ var BOOKMARK_SCHEMA = createSchema({
|
|
|
444
438
|
BOOKMARK_INDEX_POSITION_ATTRIBUTE
|
|
445
439
|
],
|
|
446
440
|
optionalAttributes: [],
|
|
447
|
-
|
|
448
|
-
{
|
|
449
|
-
tagName: SEE_TAG,
|
|
450
|
-
required: false
|
|
451
|
-
}
|
|
452
|
-
]
|
|
441
|
+
allowedChildrenCodes: [{ code: "see", required: false }]
|
|
453
442
|
});
|
|
454
443
|
|
|
455
444
|
// src/schema/elementSchemas/atoms/indexing/indexterm.ts
|
|
@@ -467,12 +456,12 @@ var INDEXTERM_SCHEMA = createSchema({
|
|
|
467
456
|
...ID_ATTRS
|
|
468
457
|
],
|
|
469
458
|
optionalAttributes: [],
|
|
470
|
-
|
|
471
|
-
{
|
|
472
|
-
{
|
|
473
|
-
{
|
|
474
|
-
{
|
|
475
|
-
{
|
|
459
|
+
allowedChildrenCodes: [
|
|
460
|
+
{ code: "primary", required: false },
|
|
461
|
+
{ code: "secondary", required: false },
|
|
462
|
+
{ code: "tertiary", required: false },
|
|
463
|
+
{ code: "quaternary", required: false },
|
|
464
|
+
{ code: "bookmark", required: false }
|
|
476
465
|
]
|
|
477
466
|
});
|
|
478
467
|
|
|
@@ -483,9 +472,9 @@ var PRIMARY_SCHEMA = createSchema({
|
|
|
483
472
|
tag: PRIMARY_TAG,
|
|
484
473
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
485
474
|
optionalAttributes: [],
|
|
486
|
-
|
|
487
|
-
...
|
|
488
|
-
{
|
|
475
|
+
allowedChildrenCodes: [
|
|
476
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
477
|
+
{ code: "see", required: false }
|
|
489
478
|
]
|
|
490
479
|
});
|
|
491
480
|
|
|
@@ -496,9 +485,9 @@ var QUATERNARY_SCHEMA = createSchema({
|
|
|
496
485
|
tag: QUATERNARY_TAG,
|
|
497
486
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
498
487
|
optionalAttributes: [],
|
|
499
|
-
|
|
500
|
-
...
|
|
501
|
-
{
|
|
488
|
+
allowedChildrenCodes: [
|
|
489
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
490
|
+
{ code: "see", required: false }
|
|
502
491
|
]
|
|
503
492
|
});
|
|
504
493
|
|
|
@@ -509,9 +498,9 @@ var SECONDARY_SCHEMA = createSchema({
|
|
|
509
498
|
tag: SECONDARY_TAG,
|
|
510
499
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
511
500
|
optionalAttributes: [],
|
|
512
|
-
|
|
513
|
-
...
|
|
514
|
-
{
|
|
501
|
+
allowedChildrenCodes: [
|
|
502
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
503
|
+
{ code: "see", required: false }
|
|
515
504
|
]
|
|
516
505
|
});
|
|
517
506
|
|
|
@@ -522,7 +511,7 @@ var SEE_SCHEMA = createSchema({
|
|
|
522
511
|
tag: SEE_TAG,
|
|
523
512
|
requiredAttributes: [...SEE_REQUIRED_ATTRIBUTES],
|
|
524
513
|
optionalAttributes: [],
|
|
525
|
-
|
|
514
|
+
allowedChildrenCodes: []
|
|
526
515
|
});
|
|
527
516
|
|
|
528
517
|
// src/schema/elementSchemas/atoms/indexing/tertiary.ts
|
|
@@ -532,9 +521,9 @@ var TERTIARY_SCHEMA = createSchema({
|
|
|
532
521
|
tag: TERTIARY_TAG,
|
|
533
522
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
534
523
|
optionalAttributes: [],
|
|
535
|
-
|
|
536
|
-
...
|
|
537
|
-
{
|
|
524
|
+
allowedChildrenCodes: [
|
|
525
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
526
|
+
{ code: "see", required: false }
|
|
538
527
|
]
|
|
539
528
|
});
|
|
540
529
|
|
|
@@ -555,7 +544,7 @@ var REFERENCE_MARK_SCHEMA = createSchema({
|
|
|
555
544
|
}
|
|
556
545
|
],
|
|
557
546
|
optionalAttributes: [],
|
|
558
|
-
|
|
547
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
559
548
|
});
|
|
560
549
|
|
|
561
550
|
// src/schema/elementSchemas/atoms/index.ts
|
|
@@ -686,9 +675,9 @@ var AUTHORGROUP_SCHEMA = createSchema({
|
|
|
686
675
|
tag: AUTHORGROUP_TAG,
|
|
687
676
|
requiredAttributes: [...ID_ATTRS],
|
|
688
677
|
optionalAttributes: [],
|
|
689
|
-
|
|
690
|
-
{
|
|
691
|
-
{
|
|
678
|
+
allowedChildrenCodes: [
|
|
679
|
+
{ code: "author", required: false },
|
|
680
|
+
{ code: "punc", required: false }
|
|
692
681
|
]
|
|
693
682
|
});
|
|
694
683
|
|
|
@@ -699,13 +688,13 @@ var AUTHOR_SCHEMA = createSchema({
|
|
|
699
688
|
tag: AUTHOR_TAG,
|
|
700
689
|
requiredAttributes: [...ID_ATTRS],
|
|
701
690
|
optionalAttributes: [],
|
|
702
|
-
|
|
703
|
-
{
|
|
704
|
-
{
|
|
705
|
-
{
|
|
706
|
-
{
|
|
707
|
-
{
|
|
708
|
-
{
|
|
691
|
+
allowedChildrenCodes: [
|
|
692
|
+
{ code: "personname", required: true },
|
|
693
|
+
{ code: "olink", required: true },
|
|
694
|
+
{ code: "affiliation", required: false },
|
|
695
|
+
{ code: "degrees", required: false },
|
|
696
|
+
{ code: "punc", required: false },
|
|
697
|
+
{ code: "email", required: false }
|
|
709
698
|
]
|
|
710
699
|
});
|
|
711
700
|
|
|
@@ -716,7 +705,7 @@ var OLINK_SCHEMA = createSchema({
|
|
|
716
705
|
tag: OLINK_TAG,
|
|
717
706
|
requiredAttributes: [...ID_ATTRS],
|
|
718
707
|
optionalAttributes: [],
|
|
719
|
-
|
|
708
|
+
allowedChildrenCodes: []
|
|
720
709
|
});
|
|
721
710
|
|
|
722
711
|
// src/schema/elementSchemas/elements/authors/personname.ts
|
|
@@ -726,10 +715,10 @@ var PERSONNAME_SCHEMA = createSchema({
|
|
|
726
715
|
tag: PERSONNAME_TAG,
|
|
727
716
|
requiredAttributes: [...ID_ATTRS],
|
|
728
717
|
optionalAttributes: [],
|
|
729
|
-
|
|
730
|
-
{
|
|
731
|
-
{
|
|
732
|
-
{
|
|
718
|
+
allowedChildrenCodes: [
|
|
719
|
+
{ code: "firstname", required: true },
|
|
720
|
+
{ code: "surname", required: true },
|
|
721
|
+
{ code: "honorific", required: false }
|
|
733
722
|
]
|
|
734
723
|
});
|
|
735
724
|
|
|
@@ -740,7 +729,7 @@ var FIRSTNAME_SCHEMA = createSchema({
|
|
|
740
729
|
tag: FIRSTNAME_TAG,
|
|
741
730
|
requiredAttributes: [...ID_ATTRS],
|
|
742
731
|
optionalAttributes: [],
|
|
743
|
-
|
|
732
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
744
733
|
});
|
|
745
734
|
|
|
746
735
|
// src/schema/elementSchemas/elements/authors/surname.ts
|
|
@@ -750,7 +739,7 @@ var SURNAME_SCHEMA = createSchema({
|
|
|
750
739
|
tag: SURNAME_TAG,
|
|
751
740
|
requiredAttributes: [...ID_ATTRS],
|
|
752
741
|
optionalAttributes: [],
|
|
753
|
-
|
|
742
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
754
743
|
});
|
|
755
744
|
|
|
756
745
|
// src/schema/elementSchemas/elements/authors/honorific.ts
|
|
@@ -760,7 +749,7 @@ var HONORIFIC_SCHEMA = createSchema({
|
|
|
760
749
|
tag: HONORIFIC_TAG,
|
|
761
750
|
requiredAttributes: [...ID_ATTRS],
|
|
762
751
|
optionalAttributes: [],
|
|
763
|
-
|
|
752
|
+
allowedChildrenCodes: []
|
|
764
753
|
});
|
|
765
754
|
|
|
766
755
|
// src/schema/elementSchemas/elements/authors/orgname.ts
|
|
@@ -770,7 +759,7 @@ var ORGNAME_SCHEMA = createSchema({
|
|
|
770
759
|
tag: ORGNAME_TAG,
|
|
771
760
|
requiredAttributes: [...ID_ATTRS],
|
|
772
761
|
optionalAttributes: [],
|
|
773
|
-
|
|
762
|
+
allowedChildrenCodes: []
|
|
774
763
|
});
|
|
775
764
|
|
|
776
765
|
// src/schema/elementSchemas/elements/authors/email.ts
|
|
@@ -780,7 +769,7 @@ var EMAIL_SCHEMA = createSchema({
|
|
|
780
769
|
tag: EMAIL_TAG,
|
|
781
770
|
requiredAttributes: [...ID_ATTRS],
|
|
782
771
|
optionalAttributes: [],
|
|
783
|
-
|
|
772
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
784
773
|
});
|
|
785
774
|
|
|
786
775
|
// src/schema/elementSchemas/elements/authors/org.ts
|
|
@@ -790,7 +779,7 @@ var ORG_SCHEMA = createSchema({
|
|
|
790
779
|
tag: ORG_TAG,
|
|
791
780
|
requiredAttributes: [...ID_ATTRS],
|
|
792
781
|
optionalAttributes: [],
|
|
793
|
-
|
|
782
|
+
allowedChildrenCodes: [{ code: "orgname", required: false }]
|
|
794
783
|
});
|
|
795
784
|
|
|
796
785
|
// src/schema/elementSchemas/elements/authors/affiliation.ts
|
|
@@ -800,7 +789,7 @@ var AFFILIATION_SCHEMA = createSchema({
|
|
|
800
789
|
tag: AFFILIATION_TAG,
|
|
801
790
|
requiredAttributes: [...ID_ATTRS],
|
|
802
791
|
optionalAttributes: [],
|
|
803
|
-
|
|
792
|
+
allowedChildrenCodes: [{ code: "org", required: false }]
|
|
804
793
|
});
|
|
805
794
|
|
|
806
795
|
// src/schema/elementSchemas/elements/degrees.ts
|
|
@@ -810,7 +799,7 @@ var DEGREES_SCHEMA = createSchema({
|
|
|
810
799
|
tag: DEGREES_TAG,
|
|
811
800
|
requiredAttributes: [...ID_ATTRS],
|
|
812
801
|
optionalAttributes: [],
|
|
813
|
-
|
|
802
|
+
allowedChildrenCodes: []
|
|
814
803
|
});
|
|
815
804
|
|
|
816
805
|
// src/schema/elementSchemas/elements/dialogue/line.ts
|
|
@@ -826,9 +815,9 @@ var LINE_SCHEMA = createSchema({
|
|
|
826
815
|
defaultValue: "add-element"
|
|
827
816
|
}
|
|
828
817
|
],
|
|
829
|
-
|
|
830
|
-
...
|
|
831
|
-
...
|
|
818
|
+
allowedChildrenCodes: [
|
|
819
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
820
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
832
821
|
]
|
|
833
822
|
});
|
|
834
823
|
|
|
@@ -845,7 +834,7 @@ var SPEAKER_SCHEMA = createSchema({
|
|
|
845
834
|
defaultValue: "add-element"
|
|
846
835
|
}
|
|
847
836
|
],
|
|
848
|
-
|
|
837
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
849
838
|
});
|
|
850
839
|
|
|
851
840
|
// src/schema/elementSchemas/elements/dialogue/dialogue.ts
|
|
@@ -862,9 +851,9 @@ var DIALOGUE_SCHEMA = createSchema({
|
|
|
862
851
|
defaultValue: "add-element"
|
|
863
852
|
}
|
|
864
853
|
],
|
|
865
|
-
|
|
866
|
-
{
|
|
867
|
-
{
|
|
854
|
+
allowedChildrenCodes: [
|
|
855
|
+
{ code: "line", required: false },
|
|
856
|
+
{ code: "speaker", required: true }
|
|
868
857
|
]
|
|
869
858
|
});
|
|
870
859
|
|
|
@@ -887,47 +876,39 @@ var EQUATION_SCHEMA = createSchema({
|
|
|
887
876
|
defaultValue: "added"
|
|
888
877
|
}
|
|
889
878
|
],
|
|
890
|
-
|
|
891
|
-
{
|
|
892
|
-
{
|
|
893
|
-
tagName: CAPTION_TAG,
|
|
894
|
-
required: false
|
|
895
|
-
}
|
|
896
|
-
],
|
|
897
|
-
forbiddenElements: [
|
|
898
|
-
{ code: QUERY_SCHEMA.code, resolveTo: "skip" },
|
|
899
|
-
{ code: COMMENT_SCHEMA.code, resolveTo: "skip" },
|
|
900
|
-
{ code: COMMENT_QUERY_SECTION_SCHEMA.code, resolveTo: "skip" }
|
|
879
|
+
allowedChildrenCodes: [
|
|
880
|
+
{ code: "mathphrase", required: true },
|
|
881
|
+
{ code: "caption1", required: false }
|
|
901
882
|
]
|
|
902
883
|
});
|
|
903
884
|
|
|
904
885
|
// src/schema/shared/allowedMathChildren.ts
|
|
905
|
-
var
|
|
906
|
-
{
|
|
907
|
-
{
|
|
908
|
-
{
|
|
909
|
-
{
|
|
910
|
-
{
|
|
911
|
-
{
|
|
912
|
-
{
|
|
913
|
-
{
|
|
914
|
-
{
|
|
915
|
-
{
|
|
916
|
-
{
|
|
917
|
-
{
|
|
918
|
-
{
|
|
919
|
-
{
|
|
920
|
-
{
|
|
921
|
-
{
|
|
922
|
-
{
|
|
923
|
-
{
|
|
924
|
-
{
|
|
925
|
-
{
|
|
926
|
-
{
|
|
927
|
-
{
|
|
928
|
-
{
|
|
929
|
-
{
|
|
930
|
-
{
|
|
886
|
+
var MATH_PRESENTATION_CODES_ALLOWED_CHILDREN = [
|
|
887
|
+
{ code: "merror", required: false },
|
|
888
|
+
{ code: "mfrac", required: false },
|
|
889
|
+
{ code: "mi", required: false },
|
|
890
|
+
{ code: "mmultiscripts", required: false },
|
|
891
|
+
{ code: "mn", required: false },
|
|
892
|
+
{ code: "mo", required: false },
|
|
893
|
+
{ code: "mover", required: false },
|
|
894
|
+
{ code: "mpadded", required: false },
|
|
895
|
+
{ code: "mphantom", required: false },
|
|
896
|
+
{ code: "mprescripts", required: false },
|
|
897
|
+
{ code: "mroot", required: false },
|
|
898
|
+
{ code: "mrow", required: false },
|
|
899
|
+
{ code: "ms", required: false },
|
|
900
|
+
{ code: "mspace", required: false },
|
|
901
|
+
{ code: "msqrt", required: false },
|
|
902
|
+
{ code: "mstyle", required: false },
|
|
903
|
+
{ code: "msub", required: false },
|
|
904
|
+
{ code: "msubsup", required: false },
|
|
905
|
+
{ code: "msup", required: false },
|
|
906
|
+
{ code: "mtable", required: false },
|
|
907
|
+
{ code: "mtd", required: false },
|
|
908
|
+
{ code: "mtext", required: false },
|
|
909
|
+
{ code: "mtr", required: false },
|
|
910
|
+
{ code: "munder", required: false },
|
|
911
|
+
{ code: "munderover", required: false }
|
|
931
912
|
];
|
|
932
913
|
|
|
933
914
|
// src/schema/elementSchemas/elements/equation/math.ts
|
|
@@ -937,8 +918,8 @@ var MATH_SCHEMA = createSchema({
|
|
|
937
918
|
tag: MATH_TAG,
|
|
938
919
|
requiredAttributes: [],
|
|
939
920
|
optionalAttributes: ["xmlns", "display"],
|
|
940
|
-
|
|
941
|
-
|
|
921
|
+
defaultChildCode: "mi",
|
|
922
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
942
923
|
});
|
|
943
924
|
|
|
944
925
|
// src/schema/elementSchemas/elements/equation/merror.ts
|
|
@@ -948,7 +929,7 @@ var MERROR_SCHEMA = createSchema({
|
|
|
948
929
|
tag: MERROR_TAG,
|
|
949
930
|
requiredAttributes: [],
|
|
950
931
|
optionalAttributes: [],
|
|
951
|
-
|
|
932
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
952
933
|
});
|
|
953
934
|
|
|
954
935
|
// src/schema/elementSchemas/elements/equation/mfrac.ts
|
|
@@ -958,7 +939,7 @@ var MFRAC_SCHEMA = createSchema({
|
|
|
958
939
|
tag: MFRAC_TAG,
|
|
959
940
|
requiredAttributes: [],
|
|
960
941
|
optionalAttributes: ["denomalign", "linethickness", "numalign"],
|
|
961
|
-
|
|
942
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
962
943
|
});
|
|
963
944
|
|
|
964
945
|
// src/schema/elementSchemas/elements/equation/mi.ts
|
|
@@ -968,7 +949,7 @@ var MI_SCHEMA = createSchema({
|
|
|
968
949
|
tag: MI_TAG,
|
|
969
950
|
requiredAttributes: [],
|
|
970
951
|
optionalAttributes: ["mathvariant"],
|
|
971
|
-
|
|
952
|
+
allowedChildrenCodes: []
|
|
972
953
|
});
|
|
973
954
|
|
|
974
955
|
// src/schema/elementSchemas/elements/equation/mmultiscripts.ts
|
|
@@ -978,7 +959,7 @@ var MMULTISCRIPTS_SCHEMA = createSchema({
|
|
|
978
959
|
tag: MMULTISCRIPTS_TAG,
|
|
979
960
|
requiredAttributes: [],
|
|
980
961
|
optionalAttributes: ["subscriptshift", "superscriptshift"],
|
|
981
|
-
|
|
962
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
982
963
|
});
|
|
983
964
|
|
|
984
965
|
// src/schema/elementSchemas/elements/equation/mn.ts
|
|
@@ -988,7 +969,7 @@ var MN_SCHEMA = createSchema({
|
|
|
988
969
|
tag: MN_TAG,
|
|
989
970
|
requiredAttributes: [],
|
|
990
971
|
optionalAttributes: [],
|
|
991
|
-
|
|
972
|
+
allowedChildrenCodes: []
|
|
992
973
|
});
|
|
993
974
|
|
|
994
975
|
// src/schema/elementSchemas/elements/equation/mo.ts
|
|
@@ -1011,7 +992,7 @@ var MO_SCHEMA = createSchema({
|
|
|
1011
992
|
"stretchy",
|
|
1012
993
|
"symmetric"
|
|
1013
994
|
],
|
|
1014
|
-
|
|
995
|
+
allowedChildrenCodes: []
|
|
1015
996
|
});
|
|
1016
997
|
|
|
1017
998
|
// src/schema/elementSchemas/elements/equation/mover.ts
|
|
@@ -1021,7 +1002,7 @@ var MOVER_SCHEMA = createSchema({
|
|
|
1021
1002
|
tag: MOVER_TAG,
|
|
1022
1003
|
requiredAttributes: [],
|
|
1023
1004
|
optionalAttributes: ["accent"],
|
|
1024
|
-
|
|
1005
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1025
1006
|
});
|
|
1026
1007
|
|
|
1027
1008
|
// src/schema/elementSchemas/elements/equation/mpadded.ts
|
|
@@ -1030,14 +1011,8 @@ var MPADDED_SCHEMA = createSchema({
|
|
|
1030
1011
|
kind: "element",
|
|
1031
1012
|
tag: MPADDED_TAG,
|
|
1032
1013
|
requiredAttributes: [],
|
|
1033
|
-
optionalAttributes: [
|
|
1034
|
-
|
|
1035
|
-
"height",
|
|
1036
|
-
"lspace",
|
|
1037
|
-
"voffset",
|
|
1038
|
-
"width"
|
|
1039
|
-
],
|
|
1040
|
-
allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
|
|
1014
|
+
optionalAttributes: ["depth", "height", "lspace", "voffset", "width"],
|
|
1015
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1041
1016
|
});
|
|
1042
1017
|
|
|
1043
1018
|
// src/schema/elementSchemas/elements/equation/mphantom.ts
|
|
@@ -1047,7 +1022,7 @@ var MPHANTOM_SCHEMA = createSchema({
|
|
|
1047
1022
|
tag: MPHANTOM_TAG,
|
|
1048
1023
|
requiredAttributes: [],
|
|
1049
1024
|
optionalAttributes: [],
|
|
1050
|
-
|
|
1025
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1051
1026
|
});
|
|
1052
1027
|
|
|
1053
1028
|
// src/schema/elementSchemas/elements/equation/mprescripts.ts
|
|
@@ -1057,7 +1032,7 @@ var MPRESCRIPTS_SCHEMA = createSchema({
|
|
|
1057
1032
|
tag: MPRESCRIPTS_TAG,
|
|
1058
1033
|
requiredAttributes: [],
|
|
1059
1034
|
optionalAttributes: [],
|
|
1060
|
-
|
|
1035
|
+
allowedChildrenCodes: []
|
|
1061
1036
|
});
|
|
1062
1037
|
|
|
1063
1038
|
// src/schema/elementSchemas/elements/equation/mroot.ts
|
|
@@ -1067,7 +1042,7 @@ var MROOT_SCHEMA = createSchema({
|
|
|
1067
1042
|
tag: MROOT_TAG,
|
|
1068
1043
|
requiredAttributes: [],
|
|
1069
1044
|
optionalAttributes: [],
|
|
1070
|
-
|
|
1045
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1071
1046
|
});
|
|
1072
1047
|
|
|
1073
1048
|
// src/schema/elementSchemas/elements/equation/mrow.ts
|
|
@@ -1077,7 +1052,7 @@ var MROW_SCHEMA = createSchema({
|
|
|
1077
1052
|
tag: MROW_TAG,
|
|
1078
1053
|
requiredAttributes: [],
|
|
1079
1054
|
optionalAttributes: [],
|
|
1080
|
-
|
|
1055
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1081
1056
|
});
|
|
1082
1057
|
|
|
1083
1058
|
// src/schema/elementSchemas/elements/equation/ms.ts
|
|
@@ -1087,7 +1062,7 @@ var MS_SCHEMA = createSchema({
|
|
|
1087
1062
|
tag: MS_TAG,
|
|
1088
1063
|
requiredAttributes: [],
|
|
1089
1064
|
optionalAttributes: ["lquote", "rquote"],
|
|
1090
|
-
|
|
1065
|
+
allowedChildrenCodes: []
|
|
1091
1066
|
});
|
|
1092
1067
|
|
|
1093
1068
|
// src/schema/elementSchemas/elements/equation/mspace.ts
|
|
@@ -1097,7 +1072,7 @@ var MSPACE_SCHEMA = createSchema({
|
|
|
1097
1072
|
tag: MSPACE_TAG,
|
|
1098
1073
|
requiredAttributes: [],
|
|
1099
1074
|
optionalAttributes: ["depth", "height", "width"],
|
|
1100
|
-
|
|
1075
|
+
allowedChildrenCodes: []
|
|
1101
1076
|
});
|
|
1102
1077
|
|
|
1103
1078
|
// src/schema/elementSchemas/elements/equation/msqrt.ts
|
|
@@ -1107,7 +1082,7 @@ var MSQRT_SCHEMA = createSchema({
|
|
|
1107
1082
|
tag: MSQRT_TAG,
|
|
1108
1083
|
requiredAttributes: [],
|
|
1109
1084
|
optionalAttributes: [],
|
|
1110
|
-
|
|
1085
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1111
1086
|
});
|
|
1112
1087
|
|
|
1113
1088
|
// src/schema/elementSchemas/elements/equation/mstyle.ts
|
|
@@ -1125,7 +1100,7 @@ var MSTYLE_SCHEMA = createSchema({
|
|
|
1125
1100
|
"scriptminsize",
|
|
1126
1101
|
"scriptsizemultiplier"
|
|
1127
1102
|
],
|
|
1128
|
-
|
|
1103
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1129
1104
|
});
|
|
1130
1105
|
|
|
1131
1106
|
// src/schema/elementSchemas/elements/equation/msub.ts
|
|
@@ -1135,7 +1110,7 @@ var MSUB_SCHEMA = createSchema({
|
|
|
1135
1110
|
tag: MSUB_TAG,
|
|
1136
1111
|
requiredAttributes: [],
|
|
1137
1112
|
optionalAttributes: ["subscriptshift"],
|
|
1138
|
-
|
|
1113
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1139
1114
|
});
|
|
1140
1115
|
|
|
1141
1116
|
// src/schema/elementSchemas/elements/equation/msubsup.ts
|
|
@@ -1145,7 +1120,7 @@ var MSUBSUP_SCHEMA = createSchema({
|
|
|
1145
1120
|
tag: MSUBSUP_TAG,
|
|
1146
1121
|
requiredAttributes: [],
|
|
1147
1122
|
optionalAttributes: ["subscriptshift", "superscriptshift"],
|
|
1148
|
-
|
|
1123
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1149
1124
|
});
|
|
1150
1125
|
|
|
1151
1126
|
// src/schema/elementSchemas/elements/equation/msup.ts
|
|
@@ -1155,7 +1130,7 @@ var MSUP_SCHEMA = createSchema({
|
|
|
1155
1130
|
tag: MSUP_TAG,
|
|
1156
1131
|
requiredAttributes: [],
|
|
1157
1132
|
optionalAttributes: ["superscriptshift"],
|
|
1158
|
-
|
|
1133
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1159
1134
|
});
|
|
1160
1135
|
|
|
1161
1136
|
// src/schema/elementSchemas/elements/equation/mtable.ts
|
|
@@ -1178,7 +1153,7 @@ var MTABLE_SCHEMA = createSchema({
|
|
|
1178
1153
|
"rowspacing",
|
|
1179
1154
|
"width"
|
|
1180
1155
|
],
|
|
1181
|
-
|
|
1156
|
+
allowedChildrenCodes: [{ code: "mtr", required: false }]
|
|
1182
1157
|
});
|
|
1183
1158
|
|
|
1184
1159
|
// src/schema/elementSchemas/elements/equation/mtd.ts
|
|
@@ -1187,13 +1162,8 @@ var MTD_SCHEMA = createSchema({
|
|
|
1187
1162
|
kind: "element",
|
|
1188
1163
|
tag: MTD_TAG,
|
|
1189
1164
|
requiredAttributes: [],
|
|
1190
|
-
optionalAttributes: [
|
|
1191
|
-
|
|
1192
|
-
"columnspan",
|
|
1193
|
-
"rowalign",
|
|
1194
|
-
"rowspan"
|
|
1195
|
-
],
|
|
1196
|
-
allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
|
|
1165
|
+
optionalAttributes: ["columnalign", "columnspan", "rowalign", "rowspan"],
|
|
1166
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1197
1167
|
});
|
|
1198
1168
|
|
|
1199
1169
|
// src/schema/elementSchemas/elements/equation/mtext.ts
|
|
@@ -1203,7 +1173,7 @@ var MTEXT_SCHEMA = createSchema({
|
|
|
1203
1173
|
tag: MTEXT_TAG,
|
|
1204
1174
|
requiredAttributes: [],
|
|
1205
1175
|
optionalAttributes: ["mathvariant"],
|
|
1206
|
-
|
|
1176
|
+
allowedChildrenCodes: []
|
|
1207
1177
|
});
|
|
1208
1178
|
|
|
1209
1179
|
// src/schema/elementSchemas/elements/equation/mtr.ts
|
|
@@ -1213,7 +1183,7 @@ var MTR_SCHEMA = createSchema({
|
|
|
1213
1183
|
tag: MTR_TAG,
|
|
1214
1184
|
requiredAttributes: [],
|
|
1215
1185
|
optionalAttributes: ["columnalign", "rowalign"],
|
|
1216
|
-
|
|
1186
|
+
allowedChildrenCodes: [{ code: "mtd", required: false }]
|
|
1217
1187
|
});
|
|
1218
1188
|
|
|
1219
1189
|
// src/schema/elementSchemas/elements/equation/munder.ts
|
|
@@ -1223,7 +1193,7 @@ var MUNDER_SCHEMA = createSchema({
|
|
|
1223
1193
|
tag: MUNDER_TAG,
|
|
1224
1194
|
requiredAttributes: [],
|
|
1225
1195
|
optionalAttributes: ["accentunder"],
|
|
1226
|
-
|
|
1196
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1227
1197
|
});
|
|
1228
1198
|
|
|
1229
1199
|
// src/schema/elementSchemas/elements/equation/munderover.ts
|
|
@@ -1233,7 +1203,7 @@ var MUNDEROVER_SCHEMA = createSchema({
|
|
|
1233
1203
|
tag: MUNDEROVER_TAG,
|
|
1234
1204
|
requiredAttributes: [],
|
|
1235
1205
|
optionalAttributes: ["accent", "accentunder"],
|
|
1236
|
-
|
|
1206
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1237
1207
|
});
|
|
1238
1208
|
|
|
1239
1209
|
// src/schema/elementSchemas/elements/figure/img.ts
|
|
@@ -1254,7 +1224,7 @@ var IMG_SCHEMA = createSchema({
|
|
|
1254
1224
|
defaultValue: "inline-graphics"
|
|
1255
1225
|
}
|
|
1256
1226
|
],
|
|
1257
|
-
|
|
1227
|
+
allowedChildrenCodes: []
|
|
1258
1228
|
});
|
|
1259
1229
|
|
|
1260
1230
|
// src/schema/elementSchemas/elements/figure/alttext.ts
|
|
@@ -1264,7 +1234,7 @@ var ALTTEXT_SCHEMA = createSchema({
|
|
|
1264
1234
|
tag: ALTTEXT_TAG,
|
|
1265
1235
|
requiredAttributes: [],
|
|
1266
1236
|
optionalAttributes: [],
|
|
1267
|
-
|
|
1237
|
+
allowedChildrenCodes: [{ code: "content", required: false }]
|
|
1268
1238
|
});
|
|
1269
1239
|
|
|
1270
1240
|
// src/schema/elementSchemas/elements/figure/imageobject.ts
|
|
@@ -1274,9 +1244,9 @@ var IMAGEOBJECT_SCHEMA = createSchema({
|
|
|
1274
1244
|
tag: IMAGEOBJECT_TAG,
|
|
1275
1245
|
requiredAttributes: [...ID_ATTRS],
|
|
1276
1246
|
optionalAttributes: [],
|
|
1277
|
-
|
|
1278
|
-
{
|
|
1279
|
-
{
|
|
1247
|
+
allowedChildrenCodes: [
|
|
1248
|
+
{ code: "img", required: false },
|
|
1249
|
+
{ code: "alttext", required: false }
|
|
1280
1250
|
]
|
|
1281
1251
|
});
|
|
1282
1252
|
|
|
@@ -1287,7 +1257,7 @@ var MEDIAOBJECT_SCHEMA = createSchema({
|
|
|
1287
1257
|
tag: MEDIAOBJECT_TAG,
|
|
1288
1258
|
requiredAttributes: [...ID_ATTRS],
|
|
1289
1259
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1290
|
-
|
|
1260
|
+
allowedChildrenCodes: [{ code: "imageobject", required: false }]
|
|
1291
1261
|
});
|
|
1292
1262
|
|
|
1293
1263
|
// src/schema/elementSchemas/elements/figure/caption1.ts
|
|
@@ -1297,7 +1267,7 @@ var CAPTION_SCHEMA = createSchema({
|
|
|
1297
1267
|
tag: CAPTION_TAG,
|
|
1298
1268
|
requiredAttributes: [...ID_ATTRS],
|
|
1299
1269
|
optionalAttributes: [],
|
|
1300
|
-
|
|
1270
|
+
allowedChildrenCodes: [{ code: "para", required: false }]
|
|
1301
1271
|
});
|
|
1302
1272
|
|
|
1303
1273
|
// src/schema/elementSchemas/elements/figure/figsource.ts
|
|
@@ -1307,9 +1277,9 @@ var FIGSOURCE_SCHEMA = createSchema({
|
|
|
1307
1277
|
tag: FIGSOURCE_TAG,
|
|
1308
1278
|
requiredAttributes: [...ID_ATTRS],
|
|
1309
1279
|
optionalAttributes: [],
|
|
1310
|
-
|
|
1311
|
-
...
|
|
1312
|
-
...
|
|
1280
|
+
allowedChildrenCodes: [
|
|
1281
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1282
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1313
1283
|
]
|
|
1314
1284
|
});
|
|
1315
1285
|
|
|
@@ -1320,9 +1290,9 @@ var FIGNOTE_SCHEMA = createSchema({
|
|
|
1320
1290
|
tag: FIGNOTE_TAG,
|
|
1321
1291
|
requiredAttributes: [...ID_ATTRS],
|
|
1322
1292
|
optionalAttributes: [],
|
|
1323
|
-
|
|
1324
|
-
...
|
|
1325
|
-
...
|
|
1293
|
+
allowedChildrenCodes: [
|
|
1294
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1295
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1326
1296
|
]
|
|
1327
1297
|
});
|
|
1328
1298
|
|
|
@@ -1339,12 +1309,12 @@ var FIGURE_SCHEMA = createSchema({
|
|
|
1339
1309
|
"linkend_fig",
|
|
1340
1310
|
"data-anchor-id"
|
|
1341
1311
|
],
|
|
1342
|
-
|
|
1343
|
-
{
|
|
1344
|
-
{
|
|
1345
|
-
{
|
|
1346
|
-
{
|
|
1347
|
-
{
|
|
1312
|
+
allowedChildrenCodes: [
|
|
1313
|
+
{ code: "mediaobject", required: false },
|
|
1314
|
+
{ code: "label1", required: false },
|
|
1315
|
+
{ code: "caption1", required: false },
|
|
1316
|
+
{ code: "figsource", required: false },
|
|
1317
|
+
{ code: "fignote", required: false }
|
|
1348
1318
|
]
|
|
1349
1319
|
});
|
|
1350
1320
|
|
|
@@ -1364,9 +1334,9 @@ var FOOTNOTE_SCHEMA = createSchema({
|
|
|
1364
1334
|
}
|
|
1365
1335
|
],
|
|
1366
1336
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1367
|
-
|
|
1368
|
-
{
|
|
1369
|
-
{
|
|
1337
|
+
allowedChildrenCodes: [
|
|
1338
|
+
{ code: "footnoteno", required: false },
|
|
1339
|
+
{ code: "para", required: false }
|
|
1370
1340
|
]
|
|
1371
1341
|
});
|
|
1372
1342
|
|
|
@@ -1377,7 +1347,7 @@ var FOOTNOTE_NUMBER_SCHEMA = createSchema({
|
|
|
1377
1347
|
tag: FOOTNOTE_NUMBER_TAG,
|
|
1378
1348
|
requiredAttributes: [...ID_ATTRS],
|
|
1379
1349
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1380
|
-
|
|
1350
|
+
allowedChildrenCodes: []
|
|
1381
1351
|
});
|
|
1382
1352
|
|
|
1383
1353
|
// src/schema/elementSchemas/elements/informalfigure.ts
|
|
@@ -1387,9 +1357,9 @@ var INFORMALFIGURE_SCHEMA = createSchema({
|
|
|
1387
1357
|
tag: INFORMALFIGURE_TAG,
|
|
1388
1358
|
requiredAttributes: [...ID_ATTRS],
|
|
1389
1359
|
optionalAttributes: [...TRACK_CHANGES_ATTRS, "data-anchor-id"],
|
|
1390
|
-
|
|
1391
|
-
{
|
|
1392
|
-
{
|
|
1360
|
+
allowedChildrenCodes: [
|
|
1361
|
+
{ code: "mediaobject", required: false },
|
|
1362
|
+
{ code: "tag", required: false }
|
|
1393
1363
|
]
|
|
1394
1364
|
});
|
|
1395
1365
|
|
|
@@ -1407,10 +1377,10 @@ var KEYWORDSET_SCHEMA = createSchema({
|
|
|
1407
1377
|
}
|
|
1408
1378
|
],
|
|
1409
1379
|
optionalAttributes: [],
|
|
1410
|
-
|
|
1411
|
-
{
|
|
1412
|
-
{
|
|
1413
|
-
{
|
|
1380
|
+
allowedChildrenCodes: [
|
|
1381
|
+
{ code: "keyword", required: false },
|
|
1382
|
+
{ code: "title1", required: false },
|
|
1383
|
+
{ code: "punc", required: false }
|
|
1414
1384
|
]
|
|
1415
1385
|
});
|
|
1416
1386
|
|
|
@@ -1421,9 +1391,9 @@ var KEYWORD_SCHEMA = createSchema({
|
|
|
1421
1391
|
tag: KEYWORD_TAG,
|
|
1422
1392
|
requiredAttributes: [...ID_ATTRS],
|
|
1423
1393
|
optionalAttributes: ["data-pos"],
|
|
1424
|
-
|
|
1425
|
-
...
|
|
1426
|
-
{
|
|
1394
|
+
allowedChildrenCodes: [
|
|
1395
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1396
|
+
{ code: "phrase", required: false }
|
|
1427
1397
|
]
|
|
1428
1398
|
});
|
|
1429
1399
|
|
|
@@ -1434,7 +1404,7 @@ var PUNC_SCHEMA = createSchema({
|
|
|
1434
1404
|
tag: PUNC_TAG,
|
|
1435
1405
|
requiredAttributes: [...ID_ATTRS],
|
|
1436
1406
|
optionalAttributes: ["data-role"],
|
|
1437
|
-
|
|
1407
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
1438
1408
|
});
|
|
1439
1409
|
|
|
1440
1410
|
// src/schema/elementSchemas/elements/label.ts
|
|
@@ -1451,12 +1421,9 @@ var LABEL_SCHEMA = createSchema({
|
|
|
1451
1421
|
defaultValue: "false"
|
|
1452
1422
|
}
|
|
1453
1423
|
],
|
|
1454
|
-
|
|
1455
|
-
...
|
|
1456
|
-
{
|
|
1457
|
-
tagName: LINK_TAG,
|
|
1458
|
-
required: false
|
|
1459
|
-
}
|
|
1424
|
+
allowedChildrenCodes: [
|
|
1425
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1426
|
+
{ code: "link", required: false }
|
|
1460
1427
|
]
|
|
1461
1428
|
});
|
|
1462
1429
|
|
|
@@ -1467,7 +1434,7 @@ var TOKEN_SCHEMA = createSchema({
|
|
|
1467
1434
|
tag: TOKEN_TAG,
|
|
1468
1435
|
requiredAttributes: [...ID_ATTRS],
|
|
1469
1436
|
optionalAttributes: [],
|
|
1470
|
-
|
|
1437
|
+
allowedChildrenCodes: []
|
|
1471
1438
|
});
|
|
1472
1439
|
|
|
1473
1440
|
// src/schema/elementSchemas/elements/list/li.ts
|
|
@@ -1491,11 +1458,11 @@ var LI_SCHEMA = createSchema({
|
|
|
1491
1458
|
defaultValue: "add-element"
|
|
1492
1459
|
}
|
|
1493
1460
|
],
|
|
1494
|
-
|
|
1495
|
-
{
|
|
1496
|
-
{
|
|
1497
|
-
{
|
|
1498
|
-
{
|
|
1461
|
+
allowedChildrenCodes: [
|
|
1462
|
+
{ code: "para", required: false },
|
|
1463
|
+
{ code: "tag", required: false },
|
|
1464
|
+
{ code: "ul", required: false },
|
|
1465
|
+
{ code: "ol", required: false }
|
|
1499
1466
|
]
|
|
1500
1467
|
});
|
|
1501
1468
|
|
|
@@ -1533,7 +1500,7 @@ var OL_SCHEMA = createSchema({
|
|
|
1533
1500
|
defaultValue: "disc"
|
|
1534
1501
|
}
|
|
1535
1502
|
],
|
|
1536
|
-
|
|
1503
|
+
allowedChildrenCodes: [{ code: "li", required: false }]
|
|
1537
1504
|
});
|
|
1538
1505
|
|
|
1539
1506
|
// src/schema/elementSchemas/elements/list/ul.ts
|
|
@@ -1574,7 +1541,7 @@ var UL_SCHEMA = createSchema({
|
|
|
1574
1541
|
defaultValue: "disc"
|
|
1575
1542
|
}
|
|
1576
1543
|
],
|
|
1577
|
-
|
|
1544
|
+
allowedChildrenCodes: [{ code: "li", required: false }]
|
|
1578
1545
|
});
|
|
1579
1546
|
|
|
1580
1547
|
// src/schema/elementSchemas/elements/para.ts
|
|
@@ -1590,17 +1557,17 @@ var PARA_SCHEMA = createSchema({
|
|
|
1590
1557
|
"role",
|
|
1591
1558
|
"data-pos"
|
|
1592
1559
|
],
|
|
1593
|
-
|
|
1594
|
-
...
|
|
1595
|
-
...
|
|
1596
|
-
{
|
|
1597
|
-
{
|
|
1598
|
-
{
|
|
1599
|
-
{
|
|
1600
|
-
{
|
|
1601
|
-
{
|
|
1602
|
-
{
|
|
1603
|
-
{
|
|
1560
|
+
allowedChildrenCodes: [
|
|
1561
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1562
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN,
|
|
1563
|
+
{ code: "sidebar", required: false },
|
|
1564
|
+
{ code: "tag", required: false },
|
|
1565
|
+
{ code: "table1", required: false },
|
|
1566
|
+
{ code: "source1", required: false },
|
|
1567
|
+
{ code: "informalfigure", required: false },
|
|
1568
|
+
{ code: "figure1", required: false },
|
|
1569
|
+
{ code: "token", required: false },
|
|
1570
|
+
{ code: "referenceBibliomixed", required: false }
|
|
1604
1571
|
]
|
|
1605
1572
|
});
|
|
1606
1573
|
|
|
@@ -1611,7 +1578,7 @@ var TAG_SCHEMA = createSchema({
|
|
|
1611
1578
|
tag: TAG_TAG,
|
|
1612
1579
|
requiredAttributes: [...ID_ATTRS, "data-id"],
|
|
1613
1580
|
optionalAttributes: [],
|
|
1614
|
-
|
|
1581
|
+
allowedChildrenCodes: []
|
|
1615
1582
|
});
|
|
1616
1583
|
|
|
1617
1584
|
// src/schema/elementSchemas/elements/runningHeads/lrh.ts
|
|
@@ -1621,9 +1588,9 @@ var LRH_SCHEMA = createSchema({
|
|
|
1621
1588
|
tag: LRH_TAG,
|
|
1622
1589
|
requiredAttributes: [...ID_ATTRS],
|
|
1623
1590
|
optionalAttributes: [],
|
|
1624
|
-
|
|
1625
|
-
...
|
|
1626
|
-
{
|
|
1591
|
+
allowedChildrenCodes: [
|
|
1592
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1593
|
+
{ code: "phrase", required: false }
|
|
1627
1594
|
]
|
|
1628
1595
|
});
|
|
1629
1596
|
|
|
@@ -1634,9 +1601,10 @@ var RRH_SCHEMA = createSchema({
|
|
|
1634
1601
|
tag: RRH_TAG,
|
|
1635
1602
|
requiredAttributes: [...ID_ATTRS],
|
|
1636
1603
|
optionalAttributes: [],
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1604
|
+
defaultChildCode: "rrh",
|
|
1605
|
+
allowedChildrenCodes: [
|
|
1606
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1607
|
+
{ code: "phrase", required: false }
|
|
1640
1608
|
]
|
|
1641
1609
|
});
|
|
1642
1610
|
|
|
@@ -1654,9 +1622,9 @@ var SOURCE_SCHEMA = createSchema({
|
|
|
1654
1622
|
defaultValue: "add-element"
|
|
1655
1623
|
}
|
|
1656
1624
|
],
|
|
1657
|
-
|
|
1658
|
-
...
|
|
1659
|
-
...
|
|
1625
|
+
allowedChildrenCodes: [
|
|
1626
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1627
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1660
1628
|
]
|
|
1661
1629
|
});
|
|
1662
1630
|
|
|
@@ -1673,9 +1641,9 @@ var SUBTITLE_SCHEMA = createSchema({
|
|
|
1673
1641
|
defaultValue: "add-element"
|
|
1674
1642
|
}
|
|
1675
1643
|
],
|
|
1676
|
-
|
|
1677
|
-
...
|
|
1678
|
-
{
|
|
1644
|
+
allowedChildrenCodes: [
|
|
1645
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1646
|
+
{ code: "phrase", required: false }
|
|
1679
1647
|
]
|
|
1680
1648
|
});
|
|
1681
1649
|
|
|
@@ -1686,9 +1654,9 @@ var TP_SCHEMA = createSchema({
|
|
|
1686
1654
|
tag: TP_TAG,
|
|
1687
1655
|
requiredAttributes: [],
|
|
1688
1656
|
optionalAttributes: [...ID_ATTRS],
|
|
1689
|
-
|
|
1690
|
-
...
|
|
1691
|
-
...
|
|
1657
|
+
allowedChildrenCodes: [
|
|
1658
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1659
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1692
1660
|
]
|
|
1693
1661
|
});
|
|
1694
1662
|
|
|
@@ -1703,10 +1671,10 @@ var TD_SCHEMA = createSchema({
|
|
|
1703
1671
|
LAYOUT_CELL_WIDTH_ATTRIBUTE,
|
|
1704
1672
|
"width"
|
|
1705
1673
|
],
|
|
1706
|
-
|
|
1707
|
-
{
|
|
1708
|
-
{
|
|
1709
|
-
{
|
|
1674
|
+
allowedChildrenCodes: [
|
|
1675
|
+
{ code: "tp", required: false },
|
|
1676
|
+
{ code: "ul", required: false },
|
|
1677
|
+
{ code: "ol", required: false }
|
|
1710
1678
|
]
|
|
1711
1679
|
});
|
|
1712
1680
|
|
|
@@ -1717,7 +1685,7 @@ var TR_SCHEMA = createSchema({
|
|
|
1717
1685
|
tag: TR_TAG,
|
|
1718
1686
|
requiredAttributes: [],
|
|
1719
1687
|
optionalAttributes: [...LAYOUT_ATTRIBUTES, ...ID_ATTRS, "width"],
|
|
1720
|
-
|
|
1688
|
+
allowedChildrenCodes: [{ code: "td", required: true }]
|
|
1721
1689
|
});
|
|
1722
1690
|
|
|
1723
1691
|
// src/schema/elementSchemas/elements/table/thead.ts
|
|
@@ -1727,7 +1695,7 @@ var THEAD_SCHEMA = createSchema({
|
|
|
1727
1695
|
tag: THEAD_TAG,
|
|
1728
1696
|
requiredAttributes: [],
|
|
1729
1697
|
optionalAttributes: [...ID_ATTRS],
|
|
1730
|
-
|
|
1698
|
+
allowedChildrenCodes: [{ code: "tr", required: true }]
|
|
1731
1699
|
});
|
|
1732
1700
|
|
|
1733
1701
|
// src/schema/elementSchemas/elements/table/tbody.ts
|
|
@@ -1737,7 +1705,7 @@ var TBODY_SCHEMA = createSchema({
|
|
|
1737
1705
|
tag: TBODY_TAG,
|
|
1738
1706
|
requiredAttributes: [],
|
|
1739
1707
|
optionalAttributes: [...ID_ATTRS],
|
|
1740
|
-
|
|
1708
|
+
allowedChildrenCodes: [{ code: "tr", required: true }]
|
|
1741
1709
|
});
|
|
1742
1710
|
|
|
1743
1711
|
// src/schema/elementSchemas/elements/table/htmlTable.ts
|
|
@@ -1747,9 +1715,10 @@ var HTML_TABLE_SCHEMA = createSchema({
|
|
|
1747
1715
|
tag: HTML_TABLE_TAG,
|
|
1748
1716
|
requiredAttributes: [],
|
|
1749
1717
|
optionalAttributes: [...ID_ATTRS],
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
{
|
|
1718
|
+
defaultChildCode: "table",
|
|
1719
|
+
allowedChildrenCodes: [
|
|
1720
|
+
{ code: "thead", required: false },
|
|
1721
|
+
{ code: "tbody", required: true }
|
|
1753
1722
|
]
|
|
1754
1723
|
});
|
|
1755
1724
|
|
|
@@ -1760,7 +1729,7 @@ var TGROUP_SCHEMA = createSchema({
|
|
|
1760
1729
|
tag: TGROUP_TAG,
|
|
1761
1730
|
requiredAttributes: [...ID_ATTRS, "cols"],
|
|
1762
1731
|
optionalAttributes: [],
|
|
1763
|
-
|
|
1732
|
+
allowedChildrenCodes: [{ code: "table", required: true }]
|
|
1764
1733
|
});
|
|
1765
1734
|
|
|
1766
1735
|
// src/schema/elementSchemas/elements/table/tblfn.ts
|
|
@@ -1770,9 +1739,9 @@ var TBLFN_SCHEMA = createSchema({
|
|
|
1770
1739
|
tag: TBLFN_TAG,
|
|
1771
1740
|
requiredAttributes: [...ID_ATTRS],
|
|
1772
1741
|
optionalAttributes: [],
|
|
1773
|
-
|
|
1774
|
-
...
|
|
1775
|
-
...
|
|
1742
|
+
allowedChildrenCodes: [
|
|
1743
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1744
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1776
1745
|
]
|
|
1777
1746
|
});
|
|
1778
1747
|
|
|
@@ -1783,7 +1752,7 @@ var TBLSOURCE_SCHEMA = createSchema({
|
|
|
1783
1752
|
tag: TBLSOURCE_TAG,
|
|
1784
1753
|
requiredAttributes: [],
|
|
1785
1754
|
optionalAttributes: [],
|
|
1786
|
-
|
|
1755
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
1787
1756
|
});
|
|
1788
1757
|
|
|
1789
1758
|
// src/schema/elementSchemas/elements/table/table1.ts
|
|
@@ -1810,12 +1779,12 @@ var TABLE_SCHEMA = createSchema({
|
|
|
1810
1779
|
"orient",
|
|
1811
1780
|
"xmlid"
|
|
1812
1781
|
],
|
|
1813
|
-
|
|
1814
|
-
{
|
|
1815
|
-
{
|
|
1816
|
-
{
|
|
1817
|
-
{
|
|
1818
|
-
{
|
|
1782
|
+
allowedChildrenCodes: [
|
|
1783
|
+
{ code: "label1", required: false },
|
|
1784
|
+
{ code: "tgroup", required: true },
|
|
1785
|
+
{ code: "title1", required: false },
|
|
1786
|
+
{ code: "tblfn", required: false },
|
|
1787
|
+
{ code: "tblsource", required: false }
|
|
1819
1788
|
]
|
|
1820
1789
|
});
|
|
1821
1790
|
|
|
@@ -1840,9 +1809,9 @@ var TITLE_SCHEMA = createSchema({
|
|
|
1840
1809
|
defaultValue: "H1"
|
|
1841
1810
|
}
|
|
1842
1811
|
],
|
|
1843
|
-
|
|
1844
|
-
...
|
|
1845
|
-
{
|
|
1812
|
+
allowedChildrenCodes: [
|
|
1813
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1814
|
+
{ code: "phrase", required: false }
|
|
1846
1815
|
]
|
|
1847
1816
|
});
|
|
1848
1817
|
|
|
@@ -1867,12 +1836,12 @@ var ABSTRACT_SCHEMA = createSchema({
|
|
|
1867
1836
|
defaultValue: "blurb"
|
|
1868
1837
|
}
|
|
1869
1838
|
],
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
{
|
|
1873
|
-
{
|
|
1874
|
-
{
|
|
1875
|
-
{
|
|
1839
|
+
defaultChildCode: "para",
|
|
1840
|
+
allowedChildrenCodes: [
|
|
1841
|
+
{ code: "para", required: false },
|
|
1842
|
+
{ code: "title1", required: false },
|
|
1843
|
+
{ code: "ul", required: false },
|
|
1844
|
+
{ code: "ol", required: false }
|
|
1876
1845
|
]
|
|
1877
1846
|
});
|
|
1878
1847
|
|
|
@@ -1883,11 +1852,11 @@ var APPENDIX_SCHEMA = createSchema({
|
|
|
1883
1852
|
tag: APPENDIX_TAG,
|
|
1884
1853
|
requiredAttributes: [...ID_ATTRS, "id", "xmlid"],
|
|
1885
1854
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
{
|
|
1889
|
-
{
|
|
1890
|
-
{
|
|
1855
|
+
defaultChildCode: "para",
|
|
1856
|
+
allowedChildrenCodes: [
|
|
1857
|
+
{ code: "para", required: false },
|
|
1858
|
+
{ code: "title1", required: false },
|
|
1859
|
+
{ code: "label1", required: false }
|
|
1891
1860
|
]
|
|
1892
1861
|
});
|
|
1893
1862
|
|
|
@@ -1908,13 +1877,13 @@ var BLOCKQUOTE_SCHEMA = createSchema({
|
|
|
1908
1877
|
defaultValue: "add-element"
|
|
1909
1878
|
}
|
|
1910
1879
|
],
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
{
|
|
1914
|
-
{
|
|
1915
|
-
{
|
|
1916
|
-
{
|
|
1917
|
-
{
|
|
1880
|
+
defaultChildCode: "para",
|
|
1881
|
+
allowedChildrenCodes: [
|
|
1882
|
+
{ code: "para", required: false },
|
|
1883
|
+
{ code: "ul", required: false },
|
|
1884
|
+
{ code: "ol", required: false },
|
|
1885
|
+
{ code: "sidebar", required: false },
|
|
1886
|
+
{ code: "source1", required: false }
|
|
1918
1887
|
]
|
|
1919
1888
|
});
|
|
1920
1889
|
|
|
@@ -1940,10 +1909,10 @@ var BOX_SCHEMA = createSchema({
|
|
|
1940
1909
|
defaultValue: "add-element"
|
|
1941
1910
|
}
|
|
1942
1911
|
],
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
{
|
|
1946
|
-
{
|
|
1912
|
+
defaultChildCode: "para",
|
|
1913
|
+
allowedChildrenCodes: [
|
|
1914
|
+
{ code: "para", required: false },
|
|
1915
|
+
{ code: "title1", required: false }
|
|
1947
1916
|
]
|
|
1948
1917
|
});
|
|
1949
1918
|
|
|
@@ -1960,26 +1929,27 @@ var CHAPTER_SCHEMA = createSchema({
|
|
|
1960
1929
|
"data-paragraph-numbering-elements",
|
|
1961
1930
|
"data-paragraph-numbering-chapters"
|
|
1962
1931
|
],
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
{
|
|
1966
|
-
{
|
|
1967
|
-
{
|
|
1968
|
-
{
|
|
1969
|
-
{
|
|
1970
|
-
{
|
|
1971
|
-
{
|
|
1972
|
-
{
|
|
1973
|
-
{
|
|
1974
|
-
{
|
|
1975
|
-
{
|
|
1976
|
-
{
|
|
1977
|
-
{
|
|
1978
|
-
{
|
|
1979
|
-
{
|
|
1980
|
-
{
|
|
1981
|
-
{
|
|
1982
|
-
{
|
|
1932
|
+
defaultChildCode: "para",
|
|
1933
|
+
allowedChildrenCodes: [
|
|
1934
|
+
{ code: "lrh", required: false },
|
|
1935
|
+
{ code: "rrh", required: false },
|
|
1936
|
+
{ code: "info1", required: false },
|
|
1937
|
+
{ code: "heading", required: false },
|
|
1938
|
+
{ code: "footnoteSection", required: false },
|
|
1939
|
+
{ code: "para", required: false },
|
|
1940
|
+
{ code: "title1", required: false },
|
|
1941
|
+
{ code: "sidebar", required: false },
|
|
1942
|
+
{ code: "epigraph", required: false },
|
|
1943
|
+
{ code: "blockquote", required: false },
|
|
1944
|
+
{ code: "ul", required: false },
|
|
1945
|
+
{ code: "ol", required: false },
|
|
1946
|
+
{ code: "subtitle1", required: false },
|
|
1947
|
+
{ code: "poem", required: false },
|
|
1948
|
+
{ code: "dialogue", required: false },
|
|
1949
|
+
{ code: "appendix", required: false },
|
|
1950
|
+
{ code: "table1", required: false },
|
|
1951
|
+
{ code: "figure1", required: false },
|
|
1952
|
+
{ code: "referenceBibliography", required: false }
|
|
1983
1953
|
]
|
|
1984
1954
|
});
|
|
1985
1955
|
|
|
@@ -1998,8 +1968,8 @@ var EPIGRAPH_SCHEMA = createSchema({
|
|
|
1998
1968
|
defaultValue: "add-element"
|
|
1999
1969
|
}
|
|
2000
1970
|
],
|
|
2001
|
-
|
|
2002
|
-
|
|
1971
|
+
defaultChildCode: "para",
|
|
1972
|
+
allowedChildrenCodes: [{ code: "para", required: false }]
|
|
2003
1973
|
});
|
|
2004
1974
|
|
|
2005
1975
|
// src/schema/elementSchemas/elements/footnoteSection.ts
|
|
@@ -2016,10 +1986,10 @@ var FOOTNOTE_SECTION_SCHEMA = createSchema({
|
|
|
2016
1986
|
}
|
|
2017
1987
|
],
|
|
2018
1988
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
{
|
|
2022
|
-
{
|
|
1989
|
+
defaultChildCode: "para",
|
|
1990
|
+
allowedChildrenCodes: [
|
|
1991
|
+
{ code: "footnote", required: true },
|
|
1992
|
+
{ code: "title1", required: true }
|
|
2023
1993
|
]
|
|
2024
1994
|
});
|
|
2025
1995
|
|
|
@@ -2038,25 +2008,26 @@ var HEADING_SCHEMA = createSchema({
|
|
|
2038
2008
|
}
|
|
2039
2009
|
],
|
|
2040
2010
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
{
|
|
2044
|
-
{
|
|
2045
|
-
{
|
|
2046
|
-
{
|
|
2047
|
-
{
|
|
2048
|
-
{
|
|
2049
|
-
{
|
|
2050
|
-
{
|
|
2051
|
-
{
|
|
2052
|
-
{
|
|
2053
|
-
{
|
|
2054
|
-
{
|
|
2055
|
-
{
|
|
2056
|
-
{
|
|
2057
|
-
{
|
|
2058
|
-
{
|
|
2059
|
-
{
|
|
2011
|
+
defaultChildCode: "para",
|
|
2012
|
+
allowedChildrenCodes: [
|
|
2013
|
+
{ code: "title1", required: false },
|
|
2014
|
+
{ code: "label1", required: false },
|
|
2015
|
+
{ code: "para", required: false },
|
|
2016
|
+
{ code: "subtitle1", required: false },
|
|
2017
|
+
{ code: "sidebar", required: false },
|
|
2018
|
+
{ code: "epigraph", required: false },
|
|
2019
|
+
{ code: "blockquote", required: false },
|
|
2020
|
+
{ code: "ul", required: false },
|
|
2021
|
+
{ code: "ol", required: false },
|
|
2022
|
+
{ code: "poem", required: false },
|
|
2023
|
+
{ code: "dialogue", required: false },
|
|
2024
|
+
{ code: "appendix", required: false },
|
|
2025
|
+
{ code: "table1", required: false },
|
|
2026
|
+
{ code: "figure1", required: false },
|
|
2027
|
+
{ code: "heading", required: false },
|
|
2028
|
+
{ code: "footnoteSection", required: false },
|
|
2029
|
+
{ code: "info1", required: false },
|
|
2030
|
+
{ code: "equation", required: false }
|
|
2060
2031
|
]
|
|
2061
2032
|
});
|
|
2062
2033
|
|
|
@@ -2067,14 +2038,14 @@ var INFO_SCHEMA = createSchema({
|
|
|
2067
2038
|
tag: INFO_TAG,
|
|
2068
2039
|
requiredAttributes: [...ID_ATTRS],
|
|
2069
2040
|
optionalAttributes: [],
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
{
|
|
2073
|
-
{
|
|
2074
|
-
{
|
|
2075
|
-
{
|
|
2076
|
-
{
|
|
2077
|
-
{
|
|
2041
|
+
defaultChildCode: "subtitle1",
|
|
2042
|
+
allowedChildrenCodes: [
|
|
2043
|
+
{ code: "label1", required: true },
|
|
2044
|
+
{ code: "title1", required: true },
|
|
2045
|
+
{ code: "subtitle1", required: false },
|
|
2046
|
+
{ code: "abstract1", required: false },
|
|
2047
|
+
{ code: "keywordset", required: false },
|
|
2048
|
+
{ code: "authorgroup", required: false }
|
|
2078
2049
|
]
|
|
2079
2050
|
});
|
|
2080
2051
|
|
|
@@ -2085,10 +2056,10 @@ var POEM_SCHEMA = createSchema({
|
|
|
2085
2056
|
tag: POEM_TAG,
|
|
2086
2057
|
requiredAttributes: [...ID_ATTRS],
|
|
2087
2058
|
optionalAttributes: [...TRACK_CHANGES_ATTRS, "role"],
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
{
|
|
2091
|
-
{
|
|
2059
|
+
defaultChildCode: "line",
|
|
2060
|
+
allowedChildrenCodes: [
|
|
2061
|
+
{ code: "line", required: true },
|
|
2062
|
+
{ code: "source1", required: false }
|
|
2092
2063
|
]
|
|
2093
2064
|
});
|
|
2094
2065
|
|
|
@@ -2099,10 +2070,14 @@ var MATHPHRASE_SCHEMA = createSchema({
|
|
|
2099
2070
|
tag: MATHPHRASE_TAG,
|
|
2100
2071
|
requiredAttributes: [ELE_ID_ATTRIBUTE],
|
|
2101
2072
|
optionalAttributes: [],
|
|
2102
|
-
|
|
2103
|
-
{
|
|
2073
|
+
allowedChildrenCodes: [
|
|
2074
|
+
{ code: MATH_SCHEMA.code, required: true },
|
|
2075
|
+
{
|
|
2076
|
+
code: INSERTION_SCHEMA.code,
|
|
2077
|
+
required: false
|
|
2078
|
+
},
|
|
2104
2079
|
{
|
|
2105
|
-
|
|
2080
|
+
code: DELETION_SCHEMA.code,
|
|
2106
2081
|
required: false
|
|
2107
2082
|
}
|
|
2108
2083
|
]
|
|
@@ -2122,11 +2097,11 @@ var BIBLIODIV_SCHEMA = createSchema({
|
|
|
2122
2097
|
}
|
|
2123
2098
|
],
|
|
2124
2099
|
optionalAttributes: [],
|
|
2125
|
-
|
|
2126
|
-
{
|
|
2127
|
-
{
|
|
2128
|
-
{
|
|
2129
|
-
{
|
|
2100
|
+
allowedChildrenCodes: [
|
|
2101
|
+
{ code: "bibliodiv", required: false },
|
|
2102
|
+
{ code: "referenceBibliomixed", required: false },
|
|
2103
|
+
{ code: "para", required: false },
|
|
2104
|
+
{ code: "title1", required: false }
|
|
2130
2105
|
]
|
|
2131
2106
|
});
|
|
2132
2107
|
|
|
@@ -2150,11 +2125,11 @@ var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
|
|
|
2150
2125
|
}
|
|
2151
2126
|
],
|
|
2152
2127
|
optionalAttributes: [],
|
|
2153
|
-
|
|
2154
|
-
{
|
|
2155
|
-
{
|
|
2156
|
-
{
|
|
2157
|
-
{
|
|
2128
|
+
allowedChildrenCodes: [
|
|
2129
|
+
{ code: "bibliodiv", required: false },
|
|
2130
|
+
{ code: "referenceBibliomixed", required: false },
|
|
2131
|
+
{ code: "para", required: false },
|
|
2132
|
+
{ code: "title1", required: false }
|
|
2158
2133
|
]
|
|
2159
2134
|
});
|
|
2160
2135
|
|
|
@@ -2169,7 +2144,7 @@ var BIBLIOMIXED_SCHEMA = createSchema({
|
|
|
2169
2144
|
TRACK_CHANGES_ATTR_DATA_USERID,
|
|
2170
2145
|
TRACK_CHANGES_ATTR_DATA_DATE
|
|
2171
2146
|
],
|
|
2172
|
-
|
|
2147
|
+
allowedChildrenCodes: []
|
|
2173
2148
|
});
|
|
2174
2149
|
|
|
2175
2150
|
// src/schema/elementSchemas/elements/index.ts
|
|
@@ -2268,6 +2243,13 @@ var ELEMENT_SCHEMAS = {
|
|
|
2268
2243
|
affiliation: AFFILIATION_SCHEMA
|
|
2269
2244
|
};
|
|
2270
2245
|
|
|
2246
|
+
// src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
|
|
2247
|
+
var FOOTNOTE_LINK_TAG = "FOOTNOTE1";
|
|
2248
|
+
var INLINEEQUATION_TAG = "INLINEEQUATION";
|
|
2249
|
+
var LINK_TAG = "LINK1";
|
|
2250
|
+
var URI_TAG = "URI";
|
|
2251
|
+
var PHRASE_TAG = "PHRASE";
|
|
2252
|
+
|
|
2271
2253
|
// src/schema/elementSchemas/inlineElements/footnoteLink.ts
|
|
2272
2254
|
var FOOTNOTE_LINK_SCHEMA = createSchema({
|
|
2273
2255
|
code: "footnote1",
|
|
@@ -2275,8 +2257,8 @@ var FOOTNOTE_LINK_SCHEMA = createSchema({
|
|
|
2275
2257
|
tag: FOOTNOTE_LINK_TAG,
|
|
2276
2258
|
requiredAttributes: [...ID_ATTRS],
|
|
2277
2259
|
optionalAttributes: ["linkend"],
|
|
2278
|
-
|
|
2279
|
-
|
|
2260
|
+
defaultChildCode: "sup",
|
|
2261
|
+
allowedChildrenCodes: [{ code: "sup", required: true }]
|
|
2280
2262
|
});
|
|
2281
2263
|
|
|
2282
2264
|
// src/schema/elementSchemas/inlineElements/inlineequation.ts
|
|
@@ -2298,12 +2280,7 @@ var INLINEEQUATION_SCHEMA = createSchema({
|
|
|
2298
2280
|
defaultValue: "added"
|
|
2299
2281
|
}
|
|
2300
2282
|
],
|
|
2301
|
-
|
|
2302
|
-
forbiddenElements: [
|
|
2303
|
-
{ code: QUERY_SCHEMA.code, resolveTo: "skip" },
|
|
2304
|
-
{ code: COMMENT_SCHEMA.code, resolveTo: "skip" },
|
|
2305
|
-
{ code: COMMENT_QUERY_SECTION_SCHEMA.code, resolveTo: "skip" }
|
|
2306
|
-
]
|
|
2283
|
+
allowedChildrenCodes: [{ code: "mathphrase", required: true }]
|
|
2307
2284
|
});
|
|
2308
2285
|
|
|
2309
2286
|
// src/schema/elementSchemas/inlineElements/link.ts
|
|
@@ -2322,7 +2299,7 @@ var LINK_SCHEMA = createSchema({
|
|
|
2322
2299
|
}
|
|
2323
2300
|
],
|
|
2324
2301
|
optionalAttributes: [],
|
|
2325
|
-
|
|
2302
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
2326
2303
|
});
|
|
2327
2304
|
|
|
2328
2305
|
// src/schema/elementSchemas/inlineElements/uri.ts
|
|
@@ -2332,7 +2309,7 @@ var URI_SCHEMA = createSchema({
|
|
|
2332
2309
|
tag: URI_TAG,
|
|
2333
2310
|
requiredAttributes: [...ID_ATTRS],
|
|
2334
2311
|
optionalAttributes: ["linkend"],
|
|
2335
|
-
|
|
2312
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
2336
2313
|
});
|
|
2337
2314
|
|
|
2338
2315
|
// src/schema/elementSchemas/inlineElements/phrase.ts
|
|
@@ -2342,7 +2319,7 @@ var PHRASE_SCHEMA = createSchema({
|
|
|
2342
2319
|
tag: PHRASE_TAG,
|
|
2343
2320
|
requiredAttributes: [...ID_ATTRS, "xml:lang"],
|
|
2344
2321
|
optionalAttributes: [],
|
|
2345
|
-
|
|
2322
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
2346
2323
|
});
|
|
2347
2324
|
|
|
2348
2325
|
// src/schema/elementSchemas/inlineElements/index.ts
|
|
@@ -2494,6 +2471,9 @@ var IGNORED_ELEMENT_SELECTORS = [
|
|
|
2494
2471
|
"span.missLink",
|
|
2495
2472
|
"span.ref-drag"
|
|
2496
2473
|
];
|
|
2474
|
+
var IGNORED_VALIDATION_ELEMENT_SELECTORS = [
|
|
2475
|
+
"referenceBibliomixed"
|
|
2476
|
+
];
|
|
2497
2477
|
|
|
2498
2478
|
// src/schema/shared/ignoredAttributes.ts
|
|
2499
2479
|
var IGNORED_ATTRIBUTES = [
|
|
@@ -2520,13 +2500,8 @@ var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute) |
|
|
|
2520
2500
|
(startsWith) => attribute.startsWith(startsWith)
|
|
2521
2501
|
);
|
|
2522
2502
|
var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
|
|
2503
|
+
var isIgnoredValidation = (code) => IGNORED_VALIDATION_ELEMENT_SELECTORS.includes(code);
|
|
2523
2504
|
var findSchemaByCode = (code) => SCHEMAS[code];
|
|
2524
|
-
var findSchemaByTagName = (tagName) => {
|
|
2525
|
-
const candidates = Object.values(SCHEMAS).filter(
|
|
2526
|
-
(schema) => schema.tag === tagName.toUpperCase()
|
|
2527
|
-
);
|
|
2528
|
-
return candidates;
|
|
2529
|
-
};
|
|
2530
2505
|
var findSchemaByElement = (element) => {
|
|
2531
2506
|
const tagName = element.tagName.toUpperCase();
|
|
2532
2507
|
const isInsertion = element.classList.contains("ins");
|
|
@@ -2558,14 +2533,12 @@ var findSchemaByElement = (element) => {
|
|
|
2558
2533
|
return findSchemaByCode("footnoteSection");
|
|
2559
2534
|
}
|
|
2560
2535
|
}
|
|
2561
|
-
const candidates = findSchemaByTagName(element.tagName.toUpperCase());
|
|
2562
|
-
return candidates[0];
|
|
2563
2536
|
};
|
|
2564
2537
|
var isAttributeRestricted = (attr) => typeof attr !== "string";
|
|
2565
|
-
var getAttributeName = (attribute) => typeof attribute === "string" ? attribute : attribute.name;
|
|
2538
|
+
var getAttributeName = (attribute) => typeof attribute === "string" ? attribute.toLowerCase() : attribute.name.toLowerCase();
|
|
2566
2539
|
var findAttributeDefinitionByName = (definitions, name) => {
|
|
2567
2540
|
for (const def of definitions) {
|
|
2568
|
-
if (getAttributeName(def) === name) {
|
|
2541
|
+
if (getAttributeName(def) === name.toLowerCase()) {
|
|
2569
2542
|
return def;
|
|
2570
2543
|
}
|
|
2571
2544
|
}
|
|
@@ -2797,7 +2770,7 @@ var validateAttributes = (element, schema) => {
|
|
|
2797
2770
|
};
|
|
2798
2771
|
|
|
2799
2772
|
// src/validation/validateChildren.ts
|
|
2800
|
-
var validateElementAgainstSchema = (element, schema
|
|
2773
|
+
var validateElementAgainstSchema = (element, schema) => {
|
|
2801
2774
|
const errors = [];
|
|
2802
2775
|
if (element.tagName.toUpperCase() !== schema.tag) {
|
|
2803
2776
|
addValidationIssue(errors, {
|
|
@@ -2809,20 +2782,19 @@ var validateElementAgainstSchema = (element, schema, inheritedForbiddenScope) =>
|
|
|
2809
2782
|
});
|
|
2810
2783
|
}
|
|
2811
2784
|
errors.push(...validateAttributes(element, schema));
|
|
2812
|
-
errors.push(...validateChildren(element, schema
|
|
2785
|
+
errors.push(...validateChildren(element, schema));
|
|
2813
2786
|
return errors;
|
|
2814
2787
|
};
|
|
2815
|
-
var validateChildren = (element, schema
|
|
2788
|
+
var validateChildren = (element, schema) => {
|
|
2816
2789
|
const errors = [];
|
|
2817
2790
|
const childElements = [...element.children].filter(
|
|
2818
2791
|
(child) => !isIgnoredElement(child)
|
|
2819
2792
|
);
|
|
2820
|
-
const allowedChildren = [...schema.
|
|
2793
|
+
const allowedChildren = [...schema.allowedChildrenCodes];
|
|
2821
2794
|
if (schema.kind === "atom") {
|
|
2822
2795
|
return errors;
|
|
2823
2796
|
}
|
|
2824
2797
|
for (const child of childElements) {
|
|
2825
|
-
const childTag = child.tagName.toUpperCase();
|
|
2826
2798
|
const childSchema = findSchemaByElement(child);
|
|
2827
2799
|
if (!childSchema) {
|
|
2828
2800
|
addValidationIssue(errors, {
|
|
@@ -2834,25 +2806,8 @@ var validateChildren = (element, schema, inheritedForbiddenScope) => {
|
|
|
2834
2806
|
});
|
|
2835
2807
|
continue;
|
|
2836
2808
|
}
|
|
2837
|
-
const forbiddenScope = [
|
|
2838
|
-
...inheritedForbiddenScope || [],
|
|
2839
|
-
...childSchema.forbiddenElements || []
|
|
2840
|
-
];
|
|
2841
|
-
const forbiddenChild = forbiddenScope.find(
|
|
2842
|
-
(element2) => element2.code === childSchema.code
|
|
2843
|
-
);
|
|
2844
|
-
if (forbiddenChild) {
|
|
2845
|
-
addValidationIssue(errors, {
|
|
2846
|
-
store: getStore(child),
|
|
2847
|
-
title: `Forbidden element ${child.tagName}`,
|
|
2848
|
-
level: "blocker",
|
|
2849
|
-
kind: "forbidden",
|
|
2850
|
-
description: `The element ${ElementLabel[childSchema.code]} is not permitted within ${ElementLabel[schema.code]} content. Please delete the element or move it to a different location.`
|
|
2851
|
-
});
|
|
2852
|
-
continue;
|
|
2853
|
-
}
|
|
2854
2809
|
const allowedChild = allowedChildren.find(
|
|
2855
|
-
(candidate) => candidate.
|
|
2810
|
+
(candidate) => candidate.code === childSchema.code
|
|
2856
2811
|
);
|
|
2857
2812
|
if (!allowedChild) {
|
|
2858
2813
|
addValidationIssue(errors, {
|
|
@@ -2864,32 +2819,28 @@ var validateChildren = (element, schema, inheritedForbiddenScope) => {
|
|
|
2864
2819
|
});
|
|
2865
2820
|
continue;
|
|
2866
2821
|
}
|
|
2867
|
-
errors.push(
|
|
2868
|
-
...validateElementAgainstSchema(
|
|
2869
|
-
child,
|
|
2870
|
-
childSchema,
|
|
2871
|
-
new Set(forbiddenScope)
|
|
2872
|
-
)
|
|
2873
|
-
);
|
|
2822
|
+
errors.push(...validateElementAgainstSchema(child, childSchema));
|
|
2874
2823
|
}
|
|
2875
2824
|
for (const allowedChild of allowedChildren) {
|
|
2876
2825
|
if (!allowedChild.required) {
|
|
2877
2826
|
continue;
|
|
2878
2827
|
}
|
|
2879
|
-
const hasChild = childElements.some(
|
|
2880
|
-
|
|
2881
|
-
|
|
2828
|
+
const hasChild = childElements.some((child) => {
|
|
2829
|
+
const childSchema = findSchemaByElement(child);
|
|
2830
|
+
return childSchema?.code === allowedChild.code;
|
|
2831
|
+
});
|
|
2882
2832
|
if (!hasChild) {
|
|
2833
|
+
const requiredChildLabel = ElementLabel[allowedChild.code];
|
|
2883
2834
|
addValidationIssue(errors, {
|
|
2884
2835
|
store: getStore(element),
|
|
2885
|
-
title: `Missing required child element ${
|
|
2836
|
+
title: `Missing required child element ${requiredChildLabel}`,
|
|
2886
2837
|
level: "warning",
|
|
2887
2838
|
kind: "missing",
|
|
2888
|
-
description: `The child element ${
|
|
2839
|
+
description: `The child element ${requiredChildLabel} is required but not present.`
|
|
2889
2840
|
});
|
|
2890
2841
|
}
|
|
2891
2842
|
}
|
|
2892
|
-
if (schema.
|
|
2843
|
+
if (schema.allowedChildrenCodes.size === 0 && childElements.length > 0) {
|
|
2893
2844
|
addValidationIssue(errors, {
|
|
2894
2845
|
store: getStore(element),
|
|
2895
2846
|
title: "Atom element cannot contain child elements",
|
|
@@ -2948,13 +2899,7 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
|
|
|
2948
2899
|
const schema = findSchemaByElement(element);
|
|
2949
2900
|
if (schema) {
|
|
2950
2901
|
if (schemasToValidateAgainst.includes(schema.code)) {
|
|
2951
|
-
errors.push(
|
|
2952
|
-
...validateElementAgainstSchema(
|
|
2953
|
-
element,
|
|
2954
|
-
schema,
|
|
2955
|
-
schema.forbiddenElements
|
|
2956
|
-
)
|
|
2957
|
-
);
|
|
2902
|
+
errors.push(...validateElementAgainstSchema(element, schema));
|
|
2958
2903
|
}
|
|
2959
2904
|
const role = element.getAttribute("role") || "";
|
|
2960
2905
|
const linkableRoles = getLinkableRoles();
|
|
@@ -2963,11 +2908,13 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
|
|
|
2963
2908
|
}
|
|
2964
2909
|
if (schema.tag === BIBLIOMIXED_SCHEMA.tag) {
|
|
2965
2910
|
errors.push(...validateReferenceCited(element, linkElements));
|
|
2966
|
-
return errors;
|
|
2967
2911
|
}
|
|
2968
2912
|
if (schema.tag === FOOTNOTE_SCHEMA.tag) {
|
|
2969
2913
|
errors.push(...validateFootnoteCue(element, root));
|
|
2970
2914
|
}
|
|
2915
|
+
if (isIgnoredValidation(schema.code)) {
|
|
2916
|
+
return [];
|
|
2917
|
+
}
|
|
2971
2918
|
}
|
|
2972
2919
|
for (const child of Array.from(element.children)) {
|
|
2973
2920
|
errors.push(
|
|
@@ -3011,6 +2958,7 @@ var validateXml = (xml, elementsToLink, linkElements, schemasToValidateAgainst)
|
|
|
3011
2958
|
IGNORED_ATTRIBUTES,
|
|
3012
2959
|
IGNORED_ATTRIBUTES_STARTS_WITH,
|
|
3013
2960
|
IGNORED_ELEMENT_SELECTORS,
|
|
2961
|
+
IGNORED_VALIDATION_ELEMENT_SELECTORS,
|
|
3014
2962
|
INDENT_TYPE_ATTRIBUTE,
|
|
3015
2963
|
INLINE_ELEMENT_SCHEMAS,
|
|
3016
2964
|
LAYOUT_ATTRIBUTES,
|
|
@@ -3035,10 +2983,10 @@ var validateXml = (xml, elementsToLink, linkElements, schemasToValidateAgainst)
|
|
|
3035
2983
|
findAttributeDefinitionByName,
|
|
3036
2984
|
findSchemaByCode,
|
|
3037
2985
|
findSchemaByElement,
|
|
3038
|
-
findSchemaByTagName,
|
|
3039
2986
|
getAttributeName,
|
|
3040
2987
|
isAttributeRestricted,
|
|
3041
2988
|
isIgnoredAttribute,
|
|
3042
2989
|
isIgnoredElement,
|
|
2990
|
+
isIgnoredValidation,
|
|
3043
2991
|
validateXml
|
|
3044
2992
|
});
|