pro-editor-schema 0.1.197 → 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 +9 -14
- package/dist/index.d.ts +9 -14
- package/dist/index.js +429 -445
- package/dist/index.mjs +427 -444
- package/package.json +1 -1
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,21 +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
|
-
|
|
196
191
|
// src/schema/shared/allowedInlineChildren.ts
|
|
197
|
-
var
|
|
198
|
-
{
|
|
199
|
-
{
|
|
200
|
-
{
|
|
201
|
-
{
|
|
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 }
|
|
202
198
|
];
|
|
203
199
|
|
|
204
200
|
// src/schema/elementSchemas/atoms/deletion.ts
|
|
@@ -208,9 +204,9 @@ var DELETION_SCHEMA = createSchema({
|
|
|
208
204
|
tag: SPAN_TAG,
|
|
209
205
|
requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
|
|
210
206
|
optionalAttributes: [],
|
|
211
|
-
|
|
212
|
-
...
|
|
213
|
-
...
|
|
207
|
+
allowedChildrenCodes: [
|
|
208
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
209
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
214
210
|
]
|
|
215
211
|
});
|
|
216
212
|
|
|
@@ -228,7 +224,7 @@ var EMPHASIS_SCHEMA = createSchema({
|
|
|
228
224
|
defaultValue: "lowercase"
|
|
229
225
|
}
|
|
230
226
|
],
|
|
231
|
-
|
|
227
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
232
228
|
});
|
|
233
229
|
|
|
234
230
|
// src/schema/elementSchemas/atoms/highlightmark.ts
|
|
@@ -238,7 +234,7 @@ var HIGHLIGHTMARK_SCHEMA = createSchema({
|
|
|
238
234
|
tag: HIGHLIGHTMARK_TAG,
|
|
239
235
|
requiredAttributes: [...ID_ATTRS],
|
|
240
236
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
241
|
-
|
|
237
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
242
238
|
});
|
|
243
239
|
|
|
244
240
|
// src/schema/elementSchemas/atoms/i.ts
|
|
@@ -248,7 +244,7 @@ var I_SCHEMA = createSchema({
|
|
|
248
244
|
tag: I_TAG,
|
|
249
245
|
requiredAttributes: [...ID_ATTRS],
|
|
250
246
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
251
|
-
|
|
247
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
252
248
|
});
|
|
253
249
|
|
|
254
250
|
// src/schema/elementSchemas/atoms/insertion.ts
|
|
@@ -258,9 +254,9 @@ var INSERTION_SCHEMA = createSchema({
|
|
|
258
254
|
tag: SPAN_TAG,
|
|
259
255
|
requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
|
|
260
256
|
optionalAttributes: [],
|
|
261
|
-
|
|
262
|
-
...
|
|
263
|
-
...
|
|
257
|
+
allowedChildrenCodes: [
|
|
258
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
259
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
264
260
|
]
|
|
265
261
|
});
|
|
266
262
|
|
|
@@ -271,7 +267,7 @@ var SC_SCHEMA = createSchema({
|
|
|
271
267
|
tag: SC_TAG,
|
|
272
268
|
requiredAttributes: [...ID_ATTRS],
|
|
273
269
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
274
|
-
|
|
270
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
275
271
|
});
|
|
276
272
|
|
|
277
273
|
// src/schema/elementSchemas/atoms/strike.ts
|
|
@@ -281,7 +277,7 @@ var STRIKE_SCHEMA = createSchema({
|
|
|
281
277
|
tag: STRIKE_TAG,
|
|
282
278
|
requiredAttributes: [...ID_ATTRS],
|
|
283
279
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
284
|
-
|
|
280
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
285
281
|
});
|
|
286
282
|
|
|
287
283
|
// src/schema/elementSchemas/atoms/sub.ts
|
|
@@ -291,7 +287,7 @@ var SUB_SCHEMA = createSchema({
|
|
|
291
287
|
tag: SUB_TAG,
|
|
292
288
|
requiredAttributes: [...ID_ATTRS],
|
|
293
289
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
294
|
-
|
|
290
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
295
291
|
});
|
|
296
292
|
|
|
297
293
|
// src/schema/elementSchemas/atoms/sup.ts
|
|
@@ -301,7 +297,7 @@ var SUP_SCHEMA = createSchema({
|
|
|
301
297
|
tag: SUP_TAG,
|
|
302
298
|
requiredAttributes: [...ID_ATTRS],
|
|
303
299
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
304
|
-
|
|
300
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
305
301
|
});
|
|
306
302
|
|
|
307
303
|
// src/schema/elementSchemas/atoms/u.ts
|
|
@@ -311,7 +307,7 @@ var U_SCHEMA = createSchema({
|
|
|
311
307
|
tag: U_TAG,
|
|
312
308
|
requiredAttributes: [...ID_ATTRS],
|
|
313
309
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
314
|
-
|
|
310
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
315
311
|
});
|
|
316
312
|
|
|
317
313
|
// src/schema/elementSchemas/atoms/content.ts
|
|
@@ -321,15 +317,15 @@ var CONTENT_SCHEMA = createSchema({
|
|
|
321
317
|
tag: CONTENT_TAG,
|
|
322
318
|
requiredAttributes: [...ID_ATTRS],
|
|
323
319
|
optionalAttributes: [],
|
|
324
|
-
|
|
325
|
-
{
|
|
326
|
-
{
|
|
327
|
-
{
|
|
328
|
-
{
|
|
329
|
-
{
|
|
330
|
-
{
|
|
331
|
-
{
|
|
332
|
-
{
|
|
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 }
|
|
333
329
|
]
|
|
334
330
|
});
|
|
335
331
|
|
|
@@ -350,9 +346,9 @@ var COMMENT_SCHEMA = createSchema({
|
|
|
350
346
|
"markuser",
|
|
351
347
|
"marktime"
|
|
352
348
|
],
|
|
353
|
-
|
|
354
|
-
{
|
|
355
|
-
{
|
|
349
|
+
allowedChildrenCodes: [
|
|
350
|
+
{ code: "content", required: true },
|
|
351
|
+
{ code: "reply", required: false }
|
|
356
352
|
]
|
|
357
353
|
});
|
|
358
354
|
|
|
@@ -373,9 +369,9 @@ var QUERY_SCHEMA = createSchema({
|
|
|
373
369
|
"markuser",
|
|
374
370
|
"marktime"
|
|
375
371
|
],
|
|
376
|
-
|
|
377
|
-
{
|
|
378
|
-
{
|
|
372
|
+
allowedChildrenCodes: [
|
|
373
|
+
{ code: "content", required: true },
|
|
374
|
+
{ code: "reply", required: false }
|
|
379
375
|
]
|
|
380
376
|
});
|
|
381
377
|
|
|
@@ -396,7 +392,7 @@ var REPLY_SCHEMA = createSchema({
|
|
|
396
392
|
"markuser",
|
|
397
393
|
"marktime"
|
|
398
394
|
],
|
|
399
|
-
|
|
395
|
+
allowedChildrenCodes: [{ code: "content", required: true }]
|
|
400
396
|
});
|
|
401
397
|
|
|
402
398
|
// src/schema/elementSchemas/atoms/indexing/indexTermAttributes.ts
|
|
@@ -442,12 +438,7 @@ var BOOKMARK_SCHEMA = createSchema({
|
|
|
442
438
|
BOOKMARK_INDEX_POSITION_ATTRIBUTE
|
|
443
439
|
],
|
|
444
440
|
optionalAttributes: [],
|
|
445
|
-
|
|
446
|
-
{
|
|
447
|
-
tagName: SEE_TAG,
|
|
448
|
-
required: false
|
|
449
|
-
}
|
|
450
|
-
]
|
|
441
|
+
allowedChildrenCodes: [{ code: "see", required: false }]
|
|
451
442
|
});
|
|
452
443
|
|
|
453
444
|
// src/schema/elementSchemas/atoms/indexing/indexterm.ts
|
|
@@ -465,12 +456,12 @@ var INDEXTERM_SCHEMA = createSchema({
|
|
|
465
456
|
...ID_ATTRS
|
|
466
457
|
],
|
|
467
458
|
optionalAttributes: [],
|
|
468
|
-
|
|
469
|
-
{
|
|
470
|
-
{
|
|
471
|
-
{
|
|
472
|
-
{
|
|
473
|
-
{
|
|
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 }
|
|
474
465
|
]
|
|
475
466
|
});
|
|
476
467
|
|
|
@@ -481,9 +472,9 @@ var PRIMARY_SCHEMA = createSchema({
|
|
|
481
472
|
tag: PRIMARY_TAG,
|
|
482
473
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
483
474
|
optionalAttributes: [],
|
|
484
|
-
|
|
485
|
-
...
|
|
486
|
-
{
|
|
475
|
+
allowedChildrenCodes: [
|
|
476
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
477
|
+
{ code: "see", required: false }
|
|
487
478
|
]
|
|
488
479
|
});
|
|
489
480
|
|
|
@@ -494,9 +485,9 @@ var QUATERNARY_SCHEMA = createSchema({
|
|
|
494
485
|
tag: QUATERNARY_TAG,
|
|
495
486
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
496
487
|
optionalAttributes: [],
|
|
497
|
-
|
|
498
|
-
...
|
|
499
|
-
{
|
|
488
|
+
allowedChildrenCodes: [
|
|
489
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
490
|
+
{ code: "see", required: false }
|
|
500
491
|
]
|
|
501
492
|
});
|
|
502
493
|
|
|
@@ -507,9 +498,9 @@ var SECONDARY_SCHEMA = createSchema({
|
|
|
507
498
|
tag: SECONDARY_TAG,
|
|
508
499
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
509
500
|
optionalAttributes: [],
|
|
510
|
-
|
|
511
|
-
...
|
|
512
|
-
{
|
|
501
|
+
allowedChildrenCodes: [
|
|
502
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
503
|
+
{ code: "see", required: false }
|
|
513
504
|
]
|
|
514
505
|
});
|
|
515
506
|
|
|
@@ -520,7 +511,7 @@ var SEE_SCHEMA = createSchema({
|
|
|
520
511
|
tag: SEE_TAG,
|
|
521
512
|
requiredAttributes: [...SEE_REQUIRED_ATTRIBUTES],
|
|
522
513
|
optionalAttributes: [],
|
|
523
|
-
|
|
514
|
+
allowedChildrenCodes: []
|
|
524
515
|
});
|
|
525
516
|
|
|
526
517
|
// src/schema/elementSchemas/atoms/indexing/tertiary.ts
|
|
@@ -530,9 +521,9 @@ var TERTIARY_SCHEMA = createSchema({
|
|
|
530
521
|
tag: TERTIARY_TAG,
|
|
531
522
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
532
523
|
optionalAttributes: [],
|
|
533
|
-
|
|
534
|
-
...
|
|
535
|
-
{
|
|
524
|
+
allowedChildrenCodes: [
|
|
525
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
526
|
+
{ code: "see", required: false }
|
|
536
527
|
]
|
|
537
528
|
});
|
|
538
529
|
|
|
@@ -553,7 +544,7 @@ var REFERENCE_MARK_SCHEMA = createSchema({
|
|
|
553
544
|
}
|
|
554
545
|
],
|
|
555
546
|
optionalAttributes: [],
|
|
556
|
-
|
|
547
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
557
548
|
});
|
|
558
549
|
|
|
559
550
|
// src/schema/elementSchemas/atoms/index.ts
|
|
@@ -684,9 +675,9 @@ var AUTHORGROUP_SCHEMA = createSchema({
|
|
|
684
675
|
tag: AUTHORGROUP_TAG,
|
|
685
676
|
requiredAttributes: [...ID_ATTRS],
|
|
686
677
|
optionalAttributes: [],
|
|
687
|
-
|
|
688
|
-
{
|
|
689
|
-
{
|
|
678
|
+
allowedChildrenCodes: [
|
|
679
|
+
{ code: "author", required: false },
|
|
680
|
+
{ code: "punc", required: false }
|
|
690
681
|
]
|
|
691
682
|
});
|
|
692
683
|
|
|
@@ -697,13 +688,13 @@ var AUTHOR_SCHEMA = createSchema({
|
|
|
697
688
|
tag: AUTHOR_TAG,
|
|
698
689
|
requiredAttributes: [...ID_ATTRS],
|
|
699
690
|
optionalAttributes: [],
|
|
700
|
-
|
|
701
|
-
{
|
|
702
|
-
{
|
|
703
|
-
{
|
|
704
|
-
{
|
|
705
|
-
{
|
|
706
|
-
{
|
|
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 }
|
|
707
698
|
]
|
|
708
699
|
});
|
|
709
700
|
|
|
@@ -714,7 +705,7 @@ var OLINK_SCHEMA = createSchema({
|
|
|
714
705
|
tag: OLINK_TAG,
|
|
715
706
|
requiredAttributes: [...ID_ATTRS],
|
|
716
707
|
optionalAttributes: [],
|
|
717
|
-
|
|
708
|
+
allowedChildrenCodes: []
|
|
718
709
|
});
|
|
719
710
|
|
|
720
711
|
// src/schema/elementSchemas/elements/authors/personname.ts
|
|
@@ -724,10 +715,10 @@ var PERSONNAME_SCHEMA = createSchema({
|
|
|
724
715
|
tag: PERSONNAME_TAG,
|
|
725
716
|
requiredAttributes: [...ID_ATTRS],
|
|
726
717
|
optionalAttributes: [],
|
|
727
|
-
|
|
728
|
-
{
|
|
729
|
-
{
|
|
730
|
-
{
|
|
718
|
+
allowedChildrenCodes: [
|
|
719
|
+
{ code: "firstname", required: true },
|
|
720
|
+
{ code: "surname", required: true },
|
|
721
|
+
{ code: "honorific", required: false }
|
|
731
722
|
]
|
|
732
723
|
});
|
|
733
724
|
|
|
@@ -738,7 +729,7 @@ var FIRSTNAME_SCHEMA = createSchema({
|
|
|
738
729
|
tag: FIRSTNAME_TAG,
|
|
739
730
|
requiredAttributes: [...ID_ATTRS],
|
|
740
731
|
optionalAttributes: [],
|
|
741
|
-
|
|
732
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
742
733
|
});
|
|
743
734
|
|
|
744
735
|
// src/schema/elementSchemas/elements/authors/surname.ts
|
|
@@ -748,7 +739,7 @@ var SURNAME_SCHEMA = createSchema({
|
|
|
748
739
|
tag: SURNAME_TAG,
|
|
749
740
|
requiredAttributes: [...ID_ATTRS],
|
|
750
741
|
optionalAttributes: [],
|
|
751
|
-
|
|
742
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
752
743
|
});
|
|
753
744
|
|
|
754
745
|
// src/schema/elementSchemas/elements/authors/honorific.ts
|
|
@@ -758,7 +749,7 @@ var HONORIFIC_SCHEMA = createSchema({
|
|
|
758
749
|
tag: HONORIFIC_TAG,
|
|
759
750
|
requiredAttributes: [...ID_ATTRS],
|
|
760
751
|
optionalAttributes: [],
|
|
761
|
-
|
|
752
|
+
allowedChildrenCodes: []
|
|
762
753
|
});
|
|
763
754
|
|
|
764
755
|
// src/schema/elementSchemas/elements/authors/orgname.ts
|
|
@@ -768,7 +759,7 @@ var ORGNAME_SCHEMA = createSchema({
|
|
|
768
759
|
tag: ORGNAME_TAG,
|
|
769
760
|
requiredAttributes: [...ID_ATTRS],
|
|
770
761
|
optionalAttributes: [],
|
|
771
|
-
|
|
762
|
+
allowedChildrenCodes: []
|
|
772
763
|
});
|
|
773
764
|
|
|
774
765
|
// src/schema/elementSchemas/elements/authors/email.ts
|
|
@@ -778,7 +769,7 @@ var EMAIL_SCHEMA = createSchema({
|
|
|
778
769
|
tag: EMAIL_TAG,
|
|
779
770
|
requiredAttributes: [...ID_ATTRS],
|
|
780
771
|
optionalAttributes: [],
|
|
781
|
-
|
|
772
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
782
773
|
});
|
|
783
774
|
|
|
784
775
|
// src/schema/elementSchemas/elements/authors/org.ts
|
|
@@ -788,7 +779,7 @@ var ORG_SCHEMA = createSchema({
|
|
|
788
779
|
tag: ORG_TAG,
|
|
789
780
|
requiredAttributes: [...ID_ATTRS],
|
|
790
781
|
optionalAttributes: [],
|
|
791
|
-
|
|
782
|
+
allowedChildrenCodes: [{ code: "orgname", required: false }]
|
|
792
783
|
});
|
|
793
784
|
|
|
794
785
|
// src/schema/elementSchemas/elements/authors/affiliation.ts
|
|
@@ -798,7 +789,7 @@ var AFFILIATION_SCHEMA = createSchema({
|
|
|
798
789
|
tag: AFFILIATION_TAG,
|
|
799
790
|
requiredAttributes: [...ID_ATTRS],
|
|
800
791
|
optionalAttributes: [],
|
|
801
|
-
|
|
792
|
+
allowedChildrenCodes: [{ code: "org", required: false }]
|
|
802
793
|
});
|
|
803
794
|
|
|
804
795
|
// src/schema/elementSchemas/elements/degrees.ts
|
|
@@ -808,7 +799,7 @@ var DEGREES_SCHEMA = createSchema({
|
|
|
808
799
|
tag: DEGREES_TAG,
|
|
809
800
|
requiredAttributes: [...ID_ATTRS],
|
|
810
801
|
optionalAttributes: [],
|
|
811
|
-
|
|
802
|
+
allowedChildrenCodes: []
|
|
812
803
|
});
|
|
813
804
|
|
|
814
805
|
// src/schema/elementSchemas/elements/dialogue/line.ts
|
|
@@ -824,7 +815,10 @@ var LINE_SCHEMA = createSchema({
|
|
|
824
815
|
defaultValue: "add-element"
|
|
825
816
|
}
|
|
826
817
|
],
|
|
827
|
-
|
|
818
|
+
allowedChildrenCodes: [
|
|
819
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
820
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
821
|
+
]
|
|
828
822
|
});
|
|
829
823
|
|
|
830
824
|
// src/schema/elementSchemas/elements/dialogue/speaker.ts
|
|
@@ -840,7 +834,7 @@ var SPEAKER_SCHEMA = createSchema({
|
|
|
840
834
|
defaultValue: "add-element"
|
|
841
835
|
}
|
|
842
836
|
],
|
|
843
|
-
|
|
837
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
844
838
|
});
|
|
845
839
|
|
|
846
840
|
// src/schema/elementSchemas/elements/dialogue/dialogue.ts
|
|
@@ -857,9 +851,9 @@ var DIALOGUE_SCHEMA = createSchema({
|
|
|
857
851
|
defaultValue: "add-element"
|
|
858
852
|
}
|
|
859
853
|
],
|
|
860
|
-
|
|
861
|
-
{
|
|
862
|
-
{
|
|
854
|
+
allowedChildrenCodes: [
|
|
855
|
+
{ code: "line", required: false },
|
|
856
|
+
{ code: "speaker", required: true }
|
|
863
857
|
]
|
|
864
858
|
});
|
|
865
859
|
|
|
@@ -882,47 +876,39 @@ var EQUATION_SCHEMA = createSchema({
|
|
|
882
876
|
defaultValue: "added"
|
|
883
877
|
}
|
|
884
878
|
],
|
|
885
|
-
|
|
886
|
-
{
|
|
887
|
-
{
|
|
888
|
-
tagName: CAPTION_TAG,
|
|
889
|
-
required: false
|
|
890
|
-
}
|
|
891
|
-
],
|
|
892
|
-
forbiddenElements: [
|
|
893
|
-
{ code: QUERY_SCHEMA.code, resolveTo: "skip" },
|
|
894
|
-
{ code: COMMENT_SCHEMA.code, resolveTo: "skip" },
|
|
895
|
-
{ code: COMMENT_QUERY_SECTION_SCHEMA.code, resolveTo: "skip" }
|
|
879
|
+
allowedChildrenCodes: [
|
|
880
|
+
{ code: "mathphrase", required: true },
|
|
881
|
+
{ code: "caption1", required: false }
|
|
896
882
|
]
|
|
897
883
|
});
|
|
898
884
|
|
|
899
885
|
// src/schema/shared/allowedMathChildren.ts
|
|
900
|
-
var
|
|
901
|
-
{
|
|
902
|
-
{
|
|
903
|
-
{
|
|
904
|
-
{
|
|
905
|
-
{
|
|
906
|
-
{
|
|
907
|
-
{
|
|
908
|
-
{
|
|
909
|
-
{
|
|
910
|
-
{
|
|
911
|
-
{
|
|
912
|
-
{
|
|
913
|
-
{
|
|
914
|
-
{
|
|
915
|
-
{
|
|
916
|
-
{
|
|
917
|
-
{
|
|
918
|
-
{
|
|
919
|
-
{
|
|
920
|
-
{
|
|
921
|
-
{
|
|
922
|
-
{
|
|
923
|
-
{
|
|
924
|
-
{
|
|
925
|
-
{
|
|
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 }
|
|
926
912
|
];
|
|
927
913
|
|
|
928
914
|
// src/schema/elementSchemas/elements/equation/math.ts
|
|
@@ -932,8 +918,8 @@ var MATH_SCHEMA = createSchema({
|
|
|
932
918
|
tag: MATH_TAG,
|
|
933
919
|
requiredAttributes: [],
|
|
934
920
|
optionalAttributes: ["xmlns", "display"],
|
|
935
|
-
|
|
936
|
-
|
|
921
|
+
defaultChildCode: "mi",
|
|
922
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
937
923
|
});
|
|
938
924
|
|
|
939
925
|
// src/schema/elementSchemas/elements/equation/merror.ts
|
|
@@ -943,7 +929,7 @@ var MERROR_SCHEMA = createSchema({
|
|
|
943
929
|
tag: MERROR_TAG,
|
|
944
930
|
requiredAttributes: [],
|
|
945
931
|
optionalAttributes: [],
|
|
946
|
-
|
|
932
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
947
933
|
});
|
|
948
934
|
|
|
949
935
|
// src/schema/elementSchemas/elements/equation/mfrac.ts
|
|
@@ -953,7 +939,7 @@ var MFRAC_SCHEMA = createSchema({
|
|
|
953
939
|
tag: MFRAC_TAG,
|
|
954
940
|
requiredAttributes: [],
|
|
955
941
|
optionalAttributes: ["denomalign", "linethickness", "numalign"],
|
|
956
|
-
|
|
942
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
957
943
|
});
|
|
958
944
|
|
|
959
945
|
// src/schema/elementSchemas/elements/equation/mi.ts
|
|
@@ -963,7 +949,7 @@ var MI_SCHEMA = createSchema({
|
|
|
963
949
|
tag: MI_TAG,
|
|
964
950
|
requiredAttributes: [],
|
|
965
951
|
optionalAttributes: ["mathvariant"],
|
|
966
|
-
|
|
952
|
+
allowedChildrenCodes: []
|
|
967
953
|
});
|
|
968
954
|
|
|
969
955
|
// src/schema/elementSchemas/elements/equation/mmultiscripts.ts
|
|
@@ -973,7 +959,7 @@ var MMULTISCRIPTS_SCHEMA = createSchema({
|
|
|
973
959
|
tag: MMULTISCRIPTS_TAG,
|
|
974
960
|
requiredAttributes: [],
|
|
975
961
|
optionalAttributes: ["subscriptshift", "superscriptshift"],
|
|
976
|
-
|
|
962
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
977
963
|
});
|
|
978
964
|
|
|
979
965
|
// src/schema/elementSchemas/elements/equation/mn.ts
|
|
@@ -983,7 +969,7 @@ var MN_SCHEMA = createSchema({
|
|
|
983
969
|
tag: MN_TAG,
|
|
984
970
|
requiredAttributes: [],
|
|
985
971
|
optionalAttributes: [],
|
|
986
|
-
|
|
972
|
+
allowedChildrenCodes: []
|
|
987
973
|
});
|
|
988
974
|
|
|
989
975
|
// src/schema/elementSchemas/elements/equation/mo.ts
|
|
@@ -1006,7 +992,7 @@ var MO_SCHEMA = createSchema({
|
|
|
1006
992
|
"stretchy",
|
|
1007
993
|
"symmetric"
|
|
1008
994
|
],
|
|
1009
|
-
|
|
995
|
+
allowedChildrenCodes: []
|
|
1010
996
|
});
|
|
1011
997
|
|
|
1012
998
|
// src/schema/elementSchemas/elements/equation/mover.ts
|
|
@@ -1016,7 +1002,7 @@ var MOVER_SCHEMA = createSchema({
|
|
|
1016
1002
|
tag: MOVER_TAG,
|
|
1017
1003
|
requiredAttributes: [],
|
|
1018
1004
|
optionalAttributes: ["accent"],
|
|
1019
|
-
|
|
1005
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1020
1006
|
});
|
|
1021
1007
|
|
|
1022
1008
|
// src/schema/elementSchemas/elements/equation/mpadded.ts
|
|
@@ -1025,14 +1011,8 @@ var MPADDED_SCHEMA = createSchema({
|
|
|
1025
1011
|
kind: "element",
|
|
1026
1012
|
tag: MPADDED_TAG,
|
|
1027
1013
|
requiredAttributes: [],
|
|
1028
|
-
optionalAttributes: [
|
|
1029
|
-
|
|
1030
|
-
"height",
|
|
1031
|
-
"lspace",
|
|
1032
|
-
"voffset",
|
|
1033
|
-
"width"
|
|
1034
|
-
],
|
|
1035
|
-
allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
|
|
1014
|
+
optionalAttributes: ["depth", "height", "lspace", "voffset", "width"],
|
|
1015
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1036
1016
|
});
|
|
1037
1017
|
|
|
1038
1018
|
// src/schema/elementSchemas/elements/equation/mphantom.ts
|
|
@@ -1042,7 +1022,7 @@ var MPHANTOM_SCHEMA = createSchema({
|
|
|
1042
1022
|
tag: MPHANTOM_TAG,
|
|
1043
1023
|
requiredAttributes: [],
|
|
1044
1024
|
optionalAttributes: [],
|
|
1045
|
-
|
|
1025
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1046
1026
|
});
|
|
1047
1027
|
|
|
1048
1028
|
// src/schema/elementSchemas/elements/equation/mprescripts.ts
|
|
@@ -1052,7 +1032,7 @@ var MPRESCRIPTS_SCHEMA = createSchema({
|
|
|
1052
1032
|
tag: MPRESCRIPTS_TAG,
|
|
1053
1033
|
requiredAttributes: [],
|
|
1054
1034
|
optionalAttributes: [],
|
|
1055
|
-
|
|
1035
|
+
allowedChildrenCodes: []
|
|
1056
1036
|
});
|
|
1057
1037
|
|
|
1058
1038
|
// src/schema/elementSchemas/elements/equation/mroot.ts
|
|
@@ -1062,7 +1042,7 @@ var MROOT_SCHEMA = createSchema({
|
|
|
1062
1042
|
tag: MROOT_TAG,
|
|
1063
1043
|
requiredAttributes: [],
|
|
1064
1044
|
optionalAttributes: [],
|
|
1065
|
-
|
|
1045
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1066
1046
|
});
|
|
1067
1047
|
|
|
1068
1048
|
// src/schema/elementSchemas/elements/equation/mrow.ts
|
|
@@ -1072,7 +1052,7 @@ var MROW_SCHEMA = createSchema({
|
|
|
1072
1052
|
tag: MROW_TAG,
|
|
1073
1053
|
requiredAttributes: [],
|
|
1074
1054
|
optionalAttributes: [],
|
|
1075
|
-
|
|
1055
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1076
1056
|
});
|
|
1077
1057
|
|
|
1078
1058
|
// src/schema/elementSchemas/elements/equation/ms.ts
|
|
@@ -1082,7 +1062,7 @@ var MS_SCHEMA = createSchema({
|
|
|
1082
1062
|
tag: MS_TAG,
|
|
1083
1063
|
requiredAttributes: [],
|
|
1084
1064
|
optionalAttributes: ["lquote", "rquote"],
|
|
1085
|
-
|
|
1065
|
+
allowedChildrenCodes: []
|
|
1086
1066
|
});
|
|
1087
1067
|
|
|
1088
1068
|
// src/schema/elementSchemas/elements/equation/mspace.ts
|
|
@@ -1092,7 +1072,7 @@ var MSPACE_SCHEMA = createSchema({
|
|
|
1092
1072
|
tag: MSPACE_TAG,
|
|
1093
1073
|
requiredAttributes: [],
|
|
1094
1074
|
optionalAttributes: ["depth", "height", "width"],
|
|
1095
|
-
|
|
1075
|
+
allowedChildrenCodes: []
|
|
1096
1076
|
});
|
|
1097
1077
|
|
|
1098
1078
|
// src/schema/elementSchemas/elements/equation/msqrt.ts
|
|
@@ -1102,7 +1082,7 @@ var MSQRT_SCHEMA = createSchema({
|
|
|
1102
1082
|
tag: MSQRT_TAG,
|
|
1103
1083
|
requiredAttributes: [],
|
|
1104
1084
|
optionalAttributes: [],
|
|
1105
|
-
|
|
1085
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1106
1086
|
});
|
|
1107
1087
|
|
|
1108
1088
|
// src/schema/elementSchemas/elements/equation/mstyle.ts
|
|
@@ -1120,7 +1100,7 @@ var MSTYLE_SCHEMA = createSchema({
|
|
|
1120
1100
|
"scriptminsize",
|
|
1121
1101
|
"scriptsizemultiplier"
|
|
1122
1102
|
],
|
|
1123
|
-
|
|
1103
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1124
1104
|
});
|
|
1125
1105
|
|
|
1126
1106
|
// src/schema/elementSchemas/elements/equation/msub.ts
|
|
@@ -1130,7 +1110,7 @@ var MSUB_SCHEMA = createSchema({
|
|
|
1130
1110
|
tag: MSUB_TAG,
|
|
1131
1111
|
requiredAttributes: [],
|
|
1132
1112
|
optionalAttributes: ["subscriptshift"],
|
|
1133
|
-
|
|
1113
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1134
1114
|
});
|
|
1135
1115
|
|
|
1136
1116
|
// src/schema/elementSchemas/elements/equation/msubsup.ts
|
|
@@ -1140,7 +1120,7 @@ var MSUBSUP_SCHEMA = createSchema({
|
|
|
1140
1120
|
tag: MSUBSUP_TAG,
|
|
1141
1121
|
requiredAttributes: [],
|
|
1142
1122
|
optionalAttributes: ["subscriptshift", "superscriptshift"],
|
|
1143
|
-
|
|
1123
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1144
1124
|
});
|
|
1145
1125
|
|
|
1146
1126
|
// src/schema/elementSchemas/elements/equation/msup.ts
|
|
@@ -1150,7 +1130,7 @@ var MSUP_SCHEMA = createSchema({
|
|
|
1150
1130
|
tag: MSUP_TAG,
|
|
1151
1131
|
requiredAttributes: [],
|
|
1152
1132
|
optionalAttributes: ["superscriptshift"],
|
|
1153
|
-
|
|
1133
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1154
1134
|
});
|
|
1155
1135
|
|
|
1156
1136
|
// src/schema/elementSchemas/elements/equation/mtable.ts
|
|
@@ -1173,7 +1153,7 @@ var MTABLE_SCHEMA = createSchema({
|
|
|
1173
1153
|
"rowspacing",
|
|
1174
1154
|
"width"
|
|
1175
1155
|
],
|
|
1176
|
-
|
|
1156
|
+
allowedChildrenCodes: [{ code: "mtr", required: false }]
|
|
1177
1157
|
});
|
|
1178
1158
|
|
|
1179
1159
|
// src/schema/elementSchemas/elements/equation/mtd.ts
|
|
@@ -1182,13 +1162,8 @@ var MTD_SCHEMA = createSchema({
|
|
|
1182
1162
|
kind: "element",
|
|
1183
1163
|
tag: MTD_TAG,
|
|
1184
1164
|
requiredAttributes: [],
|
|
1185
|
-
optionalAttributes: [
|
|
1186
|
-
|
|
1187
|
-
"columnspan",
|
|
1188
|
-
"rowalign",
|
|
1189
|
-
"rowspan"
|
|
1190
|
-
],
|
|
1191
|
-
allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
|
|
1165
|
+
optionalAttributes: ["columnalign", "columnspan", "rowalign", "rowspan"],
|
|
1166
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1192
1167
|
});
|
|
1193
1168
|
|
|
1194
1169
|
// src/schema/elementSchemas/elements/equation/mtext.ts
|
|
@@ -1198,7 +1173,7 @@ var MTEXT_SCHEMA = createSchema({
|
|
|
1198
1173
|
tag: MTEXT_TAG,
|
|
1199
1174
|
requiredAttributes: [],
|
|
1200
1175
|
optionalAttributes: ["mathvariant"],
|
|
1201
|
-
|
|
1176
|
+
allowedChildrenCodes: []
|
|
1202
1177
|
});
|
|
1203
1178
|
|
|
1204
1179
|
// src/schema/elementSchemas/elements/equation/mtr.ts
|
|
@@ -1208,7 +1183,7 @@ var MTR_SCHEMA = createSchema({
|
|
|
1208
1183
|
tag: MTR_TAG,
|
|
1209
1184
|
requiredAttributes: [],
|
|
1210
1185
|
optionalAttributes: ["columnalign", "rowalign"],
|
|
1211
|
-
|
|
1186
|
+
allowedChildrenCodes: [{ code: "mtd", required: false }]
|
|
1212
1187
|
});
|
|
1213
1188
|
|
|
1214
1189
|
// src/schema/elementSchemas/elements/equation/munder.ts
|
|
@@ -1218,7 +1193,7 @@ var MUNDER_SCHEMA = createSchema({
|
|
|
1218
1193
|
tag: MUNDER_TAG,
|
|
1219
1194
|
requiredAttributes: [],
|
|
1220
1195
|
optionalAttributes: ["accentunder"],
|
|
1221
|
-
|
|
1196
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1222
1197
|
});
|
|
1223
1198
|
|
|
1224
1199
|
// src/schema/elementSchemas/elements/equation/munderover.ts
|
|
@@ -1228,7 +1203,7 @@ var MUNDEROVER_SCHEMA = createSchema({
|
|
|
1228
1203
|
tag: MUNDEROVER_TAG,
|
|
1229
1204
|
requiredAttributes: [],
|
|
1230
1205
|
optionalAttributes: ["accent", "accentunder"],
|
|
1231
|
-
|
|
1206
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1232
1207
|
});
|
|
1233
1208
|
|
|
1234
1209
|
// src/schema/elementSchemas/elements/figure/img.ts
|
|
@@ -1249,7 +1224,7 @@ var IMG_SCHEMA = createSchema({
|
|
|
1249
1224
|
defaultValue: "inline-graphics"
|
|
1250
1225
|
}
|
|
1251
1226
|
],
|
|
1252
|
-
|
|
1227
|
+
allowedChildrenCodes: []
|
|
1253
1228
|
});
|
|
1254
1229
|
|
|
1255
1230
|
// src/schema/elementSchemas/elements/figure/alttext.ts
|
|
@@ -1259,7 +1234,7 @@ var ALTTEXT_SCHEMA = createSchema({
|
|
|
1259
1234
|
tag: ALTTEXT_TAG,
|
|
1260
1235
|
requiredAttributes: [],
|
|
1261
1236
|
optionalAttributes: [],
|
|
1262
|
-
|
|
1237
|
+
allowedChildrenCodes: [{ code: "content", required: false }]
|
|
1263
1238
|
});
|
|
1264
1239
|
|
|
1265
1240
|
// src/schema/elementSchemas/elements/figure/imageobject.ts
|
|
@@ -1269,9 +1244,9 @@ var IMAGEOBJECT_SCHEMA = createSchema({
|
|
|
1269
1244
|
tag: IMAGEOBJECT_TAG,
|
|
1270
1245
|
requiredAttributes: [...ID_ATTRS],
|
|
1271
1246
|
optionalAttributes: [],
|
|
1272
|
-
|
|
1273
|
-
{
|
|
1274
|
-
{
|
|
1247
|
+
allowedChildrenCodes: [
|
|
1248
|
+
{ code: "img", required: false },
|
|
1249
|
+
{ code: "alttext", required: false }
|
|
1275
1250
|
]
|
|
1276
1251
|
});
|
|
1277
1252
|
|
|
@@ -1282,7 +1257,7 @@ var MEDIAOBJECT_SCHEMA = createSchema({
|
|
|
1282
1257
|
tag: MEDIAOBJECT_TAG,
|
|
1283
1258
|
requiredAttributes: [...ID_ATTRS],
|
|
1284
1259
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1285
|
-
|
|
1260
|
+
allowedChildrenCodes: [{ code: "imageobject", required: false }]
|
|
1286
1261
|
});
|
|
1287
1262
|
|
|
1288
1263
|
// src/schema/elementSchemas/elements/figure/caption1.ts
|
|
@@ -1292,7 +1267,7 @@ var CAPTION_SCHEMA = createSchema({
|
|
|
1292
1267
|
tag: CAPTION_TAG,
|
|
1293
1268
|
requiredAttributes: [...ID_ATTRS],
|
|
1294
1269
|
optionalAttributes: [],
|
|
1295
|
-
|
|
1270
|
+
allowedChildrenCodes: [{ code: "para", required: false }]
|
|
1296
1271
|
});
|
|
1297
1272
|
|
|
1298
1273
|
// src/schema/elementSchemas/elements/figure/figsource.ts
|
|
@@ -1302,9 +1277,9 @@ var FIGSOURCE_SCHEMA = createSchema({
|
|
|
1302
1277
|
tag: FIGSOURCE_TAG,
|
|
1303
1278
|
requiredAttributes: [...ID_ATTRS],
|
|
1304
1279
|
optionalAttributes: [],
|
|
1305
|
-
|
|
1306
|
-
...
|
|
1307
|
-
...
|
|
1280
|
+
allowedChildrenCodes: [
|
|
1281
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1282
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1308
1283
|
]
|
|
1309
1284
|
});
|
|
1310
1285
|
|
|
@@ -1315,9 +1290,9 @@ var FIGNOTE_SCHEMA = createSchema({
|
|
|
1315
1290
|
tag: FIGNOTE_TAG,
|
|
1316
1291
|
requiredAttributes: [...ID_ATTRS],
|
|
1317
1292
|
optionalAttributes: [],
|
|
1318
|
-
|
|
1319
|
-
...
|
|
1320
|
-
...
|
|
1293
|
+
allowedChildrenCodes: [
|
|
1294
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1295
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1321
1296
|
]
|
|
1322
1297
|
});
|
|
1323
1298
|
|
|
@@ -1334,12 +1309,12 @@ var FIGURE_SCHEMA = createSchema({
|
|
|
1334
1309
|
"linkend_fig",
|
|
1335
1310
|
"data-anchor-id"
|
|
1336
1311
|
],
|
|
1337
|
-
|
|
1338
|
-
{
|
|
1339
|
-
{
|
|
1340
|
-
{
|
|
1341
|
-
{
|
|
1342
|
-
{
|
|
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 }
|
|
1343
1318
|
]
|
|
1344
1319
|
});
|
|
1345
1320
|
|
|
@@ -1359,9 +1334,9 @@ var FOOTNOTE_SCHEMA = createSchema({
|
|
|
1359
1334
|
}
|
|
1360
1335
|
],
|
|
1361
1336
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1362
|
-
|
|
1363
|
-
{
|
|
1364
|
-
{
|
|
1337
|
+
allowedChildrenCodes: [
|
|
1338
|
+
{ code: "footnoteno", required: false },
|
|
1339
|
+
{ code: "para", required: false }
|
|
1365
1340
|
]
|
|
1366
1341
|
});
|
|
1367
1342
|
|
|
@@ -1372,7 +1347,7 @@ var FOOTNOTE_NUMBER_SCHEMA = createSchema({
|
|
|
1372
1347
|
tag: FOOTNOTE_NUMBER_TAG,
|
|
1373
1348
|
requiredAttributes: [...ID_ATTRS],
|
|
1374
1349
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1375
|
-
|
|
1350
|
+
allowedChildrenCodes: []
|
|
1376
1351
|
});
|
|
1377
1352
|
|
|
1378
1353
|
// src/schema/elementSchemas/elements/informalfigure.ts
|
|
@@ -1382,9 +1357,9 @@ var INFORMALFIGURE_SCHEMA = createSchema({
|
|
|
1382
1357
|
tag: INFORMALFIGURE_TAG,
|
|
1383
1358
|
requiredAttributes: [...ID_ATTRS],
|
|
1384
1359
|
optionalAttributes: [...TRACK_CHANGES_ATTRS, "data-anchor-id"],
|
|
1385
|
-
|
|
1386
|
-
{
|
|
1387
|
-
{
|
|
1360
|
+
allowedChildrenCodes: [
|
|
1361
|
+
{ code: "mediaobject", required: false },
|
|
1362
|
+
{ code: "tag", required: false }
|
|
1388
1363
|
]
|
|
1389
1364
|
});
|
|
1390
1365
|
|
|
@@ -1402,10 +1377,10 @@ var KEYWORDSET_SCHEMA = createSchema({
|
|
|
1402
1377
|
}
|
|
1403
1378
|
],
|
|
1404
1379
|
optionalAttributes: [],
|
|
1405
|
-
|
|
1406
|
-
{
|
|
1407
|
-
{
|
|
1408
|
-
{
|
|
1380
|
+
allowedChildrenCodes: [
|
|
1381
|
+
{ code: "keyword", required: false },
|
|
1382
|
+
{ code: "title1", required: false },
|
|
1383
|
+
{ code: "punc", required: false }
|
|
1409
1384
|
]
|
|
1410
1385
|
});
|
|
1411
1386
|
|
|
@@ -1416,7 +1391,10 @@ var KEYWORD_SCHEMA = createSchema({
|
|
|
1416
1391
|
tag: KEYWORD_TAG,
|
|
1417
1392
|
requiredAttributes: [...ID_ATTRS],
|
|
1418
1393
|
optionalAttributes: ["data-pos"],
|
|
1419
|
-
|
|
1394
|
+
allowedChildrenCodes: [
|
|
1395
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1396
|
+
{ code: "phrase", required: false }
|
|
1397
|
+
]
|
|
1420
1398
|
});
|
|
1421
1399
|
|
|
1422
1400
|
// src/schema/elementSchemas/elements/keywords/punc.ts
|
|
@@ -1426,7 +1404,7 @@ var PUNC_SCHEMA = createSchema({
|
|
|
1426
1404
|
tag: PUNC_TAG,
|
|
1427
1405
|
requiredAttributes: [...ID_ATTRS],
|
|
1428
1406
|
optionalAttributes: ["data-role"],
|
|
1429
|
-
|
|
1407
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
1430
1408
|
});
|
|
1431
1409
|
|
|
1432
1410
|
// src/schema/elementSchemas/elements/label.ts
|
|
@@ -1443,12 +1421,9 @@ var LABEL_SCHEMA = createSchema({
|
|
|
1443
1421
|
defaultValue: "false"
|
|
1444
1422
|
}
|
|
1445
1423
|
],
|
|
1446
|
-
|
|
1447
|
-
...
|
|
1448
|
-
{
|
|
1449
|
-
tagName: LINK_TAG,
|
|
1450
|
-
required: false
|
|
1451
|
-
}
|
|
1424
|
+
allowedChildrenCodes: [
|
|
1425
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1426
|
+
{ code: "link", required: false }
|
|
1452
1427
|
]
|
|
1453
1428
|
});
|
|
1454
1429
|
|
|
@@ -1459,7 +1434,7 @@ var TOKEN_SCHEMA = createSchema({
|
|
|
1459
1434
|
tag: TOKEN_TAG,
|
|
1460
1435
|
requiredAttributes: [...ID_ATTRS],
|
|
1461
1436
|
optionalAttributes: [],
|
|
1462
|
-
|
|
1437
|
+
allowedChildrenCodes: []
|
|
1463
1438
|
});
|
|
1464
1439
|
|
|
1465
1440
|
// src/schema/elementSchemas/elements/list/li.ts
|
|
@@ -1483,11 +1458,11 @@ var LI_SCHEMA = createSchema({
|
|
|
1483
1458
|
defaultValue: "add-element"
|
|
1484
1459
|
}
|
|
1485
1460
|
],
|
|
1486
|
-
|
|
1487
|
-
{
|
|
1488
|
-
{
|
|
1489
|
-
{
|
|
1490
|
-
{
|
|
1461
|
+
allowedChildrenCodes: [
|
|
1462
|
+
{ code: "para", required: false },
|
|
1463
|
+
{ code: "tag", required: false },
|
|
1464
|
+
{ code: "ul", required: false },
|
|
1465
|
+
{ code: "ol", required: false }
|
|
1491
1466
|
]
|
|
1492
1467
|
});
|
|
1493
1468
|
|
|
@@ -1525,7 +1500,7 @@ var OL_SCHEMA = createSchema({
|
|
|
1525
1500
|
defaultValue: "disc"
|
|
1526
1501
|
}
|
|
1527
1502
|
],
|
|
1528
|
-
|
|
1503
|
+
allowedChildrenCodes: [{ code: "li", required: false }]
|
|
1529
1504
|
});
|
|
1530
1505
|
|
|
1531
1506
|
// src/schema/elementSchemas/elements/list/ul.ts
|
|
@@ -1566,7 +1541,7 @@ var UL_SCHEMA = createSchema({
|
|
|
1566
1541
|
defaultValue: "disc"
|
|
1567
1542
|
}
|
|
1568
1543
|
],
|
|
1569
|
-
|
|
1544
|
+
allowedChildrenCodes: [{ code: "li", required: false }]
|
|
1570
1545
|
});
|
|
1571
1546
|
|
|
1572
1547
|
// src/schema/elementSchemas/elements/para.ts
|
|
@@ -1582,17 +1557,17 @@ var PARA_SCHEMA = createSchema({
|
|
|
1582
1557
|
"role",
|
|
1583
1558
|
"data-pos"
|
|
1584
1559
|
],
|
|
1585
|
-
|
|
1586
|
-
...
|
|
1587
|
-
...
|
|
1588
|
-
{
|
|
1589
|
-
{
|
|
1590
|
-
{
|
|
1591
|
-
{
|
|
1592
|
-
{
|
|
1593
|
-
{
|
|
1594
|
-
{
|
|
1595
|
-
{
|
|
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 }
|
|
1596
1571
|
]
|
|
1597
1572
|
});
|
|
1598
1573
|
|
|
@@ -1603,7 +1578,7 @@ var TAG_SCHEMA = createSchema({
|
|
|
1603
1578
|
tag: TAG_TAG,
|
|
1604
1579
|
requiredAttributes: [...ID_ATTRS, "data-id"],
|
|
1605
1580
|
optionalAttributes: [],
|
|
1606
|
-
|
|
1581
|
+
allowedChildrenCodes: []
|
|
1607
1582
|
});
|
|
1608
1583
|
|
|
1609
1584
|
// src/schema/elementSchemas/elements/runningHeads/lrh.ts
|
|
@@ -1613,7 +1588,10 @@ var LRH_SCHEMA = createSchema({
|
|
|
1613
1588
|
tag: LRH_TAG,
|
|
1614
1589
|
requiredAttributes: [...ID_ATTRS],
|
|
1615
1590
|
optionalAttributes: [],
|
|
1616
|
-
|
|
1591
|
+
allowedChildrenCodes: [
|
|
1592
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1593
|
+
{ code: "phrase", required: false }
|
|
1594
|
+
]
|
|
1617
1595
|
});
|
|
1618
1596
|
|
|
1619
1597
|
// src/schema/elementSchemas/elements/runningHeads/rrh.ts
|
|
@@ -1623,7 +1601,11 @@ var RRH_SCHEMA = createSchema({
|
|
|
1623
1601
|
tag: RRH_TAG,
|
|
1624
1602
|
requiredAttributes: [...ID_ATTRS],
|
|
1625
1603
|
optionalAttributes: [],
|
|
1626
|
-
|
|
1604
|
+
defaultChildCode: "rrh",
|
|
1605
|
+
allowedChildrenCodes: [
|
|
1606
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1607
|
+
{ code: "phrase", required: false }
|
|
1608
|
+
]
|
|
1627
1609
|
});
|
|
1628
1610
|
|
|
1629
1611
|
// src/schema/elementSchemas/elements/source.ts
|
|
@@ -1640,7 +1622,10 @@ var SOURCE_SCHEMA = createSchema({
|
|
|
1640
1622
|
defaultValue: "add-element"
|
|
1641
1623
|
}
|
|
1642
1624
|
],
|
|
1643
|
-
|
|
1625
|
+
allowedChildrenCodes: [
|
|
1626
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1627
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1628
|
+
]
|
|
1644
1629
|
});
|
|
1645
1630
|
|
|
1646
1631
|
// src/schema/elementSchemas/elements/subtitle.ts
|
|
@@ -1656,7 +1641,10 @@ var SUBTITLE_SCHEMA = createSchema({
|
|
|
1656
1641
|
defaultValue: "add-element"
|
|
1657
1642
|
}
|
|
1658
1643
|
],
|
|
1659
|
-
|
|
1644
|
+
allowedChildrenCodes: [
|
|
1645
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1646
|
+
{ code: "phrase", required: false }
|
|
1647
|
+
]
|
|
1660
1648
|
});
|
|
1661
1649
|
|
|
1662
1650
|
// src/schema/elementSchemas/elements/table/tp.ts
|
|
@@ -1666,9 +1654,9 @@ var TP_SCHEMA = createSchema({
|
|
|
1666
1654
|
tag: TP_TAG,
|
|
1667
1655
|
requiredAttributes: [],
|
|
1668
1656
|
optionalAttributes: [...ID_ATTRS],
|
|
1669
|
-
|
|
1670
|
-
...
|
|
1671
|
-
...
|
|
1657
|
+
allowedChildrenCodes: [
|
|
1658
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1659
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1672
1660
|
]
|
|
1673
1661
|
});
|
|
1674
1662
|
|
|
@@ -1683,10 +1671,10 @@ var TD_SCHEMA = createSchema({
|
|
|
1683
1671
|
LAYOUT_CELL_WIDTH_ATTRIBUTE,
|
|
1684
1672
|
"width"
|
|
1685
1673
|
],
|
|
1686
|
-
|
|
1687
|
-
{
|
|
1688
|
-
{
|
|
1689
|
-
{
|
|
1674
|
+
allowedChildrenCodes: [
|
|
1675
|
+
{ code: "tp", required: false },
|
|
1676
|
+
{ code: "ul", required: false },
|
|
1677
|
+
{ code: "ol", required: false }
|
|
1690
1678
|
]
|
|
1691
1679
|
});
|
|
1692
1680
|
|
|
@@ -1697,7 +1685,7 @@ var TR_SCHEMA = createSchema({
|
|
|
1697
1685
|
tag: TR_TAG,
|
|
1698
1686
|
requiredAttributes: [],
|
|
1699
1687
|
optionalAttributes: [...LAYOUT_ATTRIBUTES, ...ID_ATTRS, "width"],
|
|
1700
|
-
|
|
1688
|
+
allowedChildrenCodes: [{ code: "td", required: true }]
|
|
1701
1689
|
});
|
|
1702
1690
|
|
|
1703
1691
|
// src/schema/elementSchemas/elements/table/thead.ts
|
|
@@ -1707,7 +1695,7 @@ var THEAD_SCHEMA = createSchema({
|
|
|
1707
1695
|
tag: THEAD_TAG,
|
|
1708
1696
|
requiredAttributes: [],
|
|
1709
1697
|
optionalAttributes: [...ID_ATTRS],
|
|
1710
|
-
|
|
1698
|
+
allowedChildrenCodes: [{ code: "tr", required: true }]
|
|
1711
1699
|
});
|
|
1712
1700
|
|
|
1713
1701
|
// src/schema/elementSchemas/elements/table/tbody.ts
|
|
@@ -1717,7 +1705,7 @@ var TBODY_SCHEMA = createSchema({
|
|
|
1717
1705
|
tag: TBODY_TAG,
|
|
1718
1706
|
requiredAttributes: [],
|
|
1719
1707
|
optionalAttributes: [...ID_ATTRS],
|
|
1720
|
-
|
|
1708
|
+
allowedChildrenCodes: [{ code: "tr", required: true }]
|
|
1721
1709
|
});
|
|
1722
1710
|
|
|
1723
1711
|
// src/schema/elementSchemas/elements/table/htmlTable.ts
|
|
@@ -1727,9 +1715,10 @@ var HTML_TABLE_SCHEMA = createSchema({
|
|
|
1727
1715
|
tag: HTML_TABLE_TAG,
|
|
1728
1716
|
requiredAttributes: [],
|
|
1729
1717
|
optionalAttributes: [...ID_ATTRS],
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
{
|
|
1718
|
+
defaultChildCode: "table",
|
|
1719
|
+
allowedChildrenCodes: [
|
|
1720
|
+
{ code: "thead", required: false },
|
|
1721
|
+
{ code: "tbody", required: true }
|
|
1733
1722
|
]
|
|
1734
1723
|
});
|
|
1735
1724
|
|
|
@@ -1740,7 +1729,7 @@ var TGROUP_SCHEMA = createSchema({
|
|
|
1740
1729
|
tag: TGROUP_TAG,
|
|
1741
1730
|
requiredAttributes: [...ID_ATTRS, "cols"],
|
|
1742
1731
|
optionalAttributes: [],
|
|
1743
|
-
|
|
1732
|
+
allowedChildrenCodes: [{ code: "table", required: true }]
|
|
1744
1733
|
});
|
|
1745
1734
|
|
|
1746
1735
|
// src/schema/elementSchemas/elements/table/tblfn.ts
|
|
@@ -1750,9 +1739,9 @@ var TBLFN_SCHEMA = createSchema({
|
|
|
1750
1739
|
tag: TBLFN_TAG,
|
|
1751
1740
|
requiredAttributes: [...ID_ATTRS],
|
|
1752
1741
|
optionalAttributes: [],
|
|
1753
|
-
|
|
1754
|
-
...
|
|
1755
|
-
...
|
|
1742
|
+
allowedChildrenCodes: [
|
|
1743
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1744
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1756
1745
|
]
|
|
1757
1746
|
});
|
|
1758
1747
|
|
|
@@ -1763,7 +1752,7 @@ var TBLSOURCE_SCHEMA = createSchema({
|
|
|
1763
1752
|
tag: TBLSOURCE_TAG,
|
|
1764
1753
|
requiredAttributes: [],
|
|
1765
1754
|
optionalAttributes: [],
|
|
1766
|
-
|
|
1755
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
1767
1756
|
});
|
|
1768
1757
|
|
|
1769
1758
|
// src/schema/elementSchemas/elements/table/table1.ts
|
|
@@ -1790,12 +1779,12 @@ var TABLE_SCHEMA = createSchema({
|
|
|
1790
1779
|
"orient",
|
|
1791
1780
|
"xmlid"
|
|
1792
1781
|
],
|
|
1793
|
-
|
|
1794
|
-
{
|
|
1795
|
-
{
|
|
1796
|
-
{
|
|
1797
|
-
{
|
|
1798
|
-
{
|
|
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 }
|
|
1799
1788
|
]
|
|
1800
1789
|
});
|
|
1801
1790
|
|
|
@@ -1820,7 +1809,10 @@ var TITLE_SCHEMA = createSchema({
|
|
|
1820
1809
|
defaultValue: "H1"
|
|
1821
1810
|
}
|
|
1822
1811
|
],
|
|
1823
|
-
|
|
1812
|
+
allowedChildrenCodes: [
|
|
1813
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1814
|
+
{ code: "phrase", required: false }
|
|
1815
|
+
]
|
|
1824
1816
|
});
|
|
1825
1817
|
|
|
1826
1818
|
// src/schema/elementSchemas/elements/abstract.ts
|
|
@@ -1844,12 +1836,12 @@ var ABSTRACT_SCHEMA = createSchema({
|
|
|
1844
1836
|
defaultValue: "blurb"
|
|
1845
1837
|
}
|
|
1846
1838
|
],
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
{
|
|
1850
|
-
{
|
|
1851
|
-
{
|
|
1852
|
-
{
|
|
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 }
|
|
1853
1845
|
]
|
|
1854
1846
|
});
|
|
1855
1847
|
|
|
@@ -1860,11 +1852,11 @@ var APPENDIX_SCHEMA = createSchema({
|
|
|
1860
1852
|
tag: APPENDIX_TAG,
|
|
1861
1853
|
requiredAttributes: [...ID_ATTRS, "id", "xmlid"],
|
|
1862
1854
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
{
|
|
1866
|
-
{
|
|
1867
|
-
{
|
|
1855
|
+
defaultChildCode: "para",
|
|
1856
|
+
allowedChildrenCodes: [
|
|
1857
|
+
{ code: "para", required: false },
|
|
1858
|
+
{ code: "title1", required: false },
|
|
1859
|
+
{ code: "label1", required: false }
|
|
1868
1860
|
]
|
|
1869
1861
|
});
|
|
1870
1862
|
|
|
@@ -1885,13 +1877,13 @@ var BLOCKQUOTE_SCHEMA = createSchema({
|
|
|
1885
1877
|
defaultValue: "add-element"
|
|
1886
1878
|
}
|
|
1887
1879
|
],
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
{
|
|
1891
|
-
{
|
|
1892
|
-
{
|
|
1893
|
-
{
|
|
1894
|
-
{
|
|
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 }
|
|
1895
1887
|
]
|
|
1896
1888
|
});
|
|
1897
1889
|
|
|
@@ -1917,10 +1909,10 @@ var BOX_SCHEMA = createSchema({
|
|
|
1917
1909
|
defaultValue: "add-element"
|
|
1918
1910
|
}
|
|
1919
1911
|
],
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
{
|
|
1923
|
-
{
|
|
1912
|
+
defaultChildCode: "para",
|
|
1913
|
+
allowedChildrenCodes: [
|
|
1914
|
+
{ code: "para", required: false },
|
|
1915
|
+
{ code: "title1", required: false }
|
|
1924
1916
|
]
|
|
1925
1917
|
});
|
|
1926
1918
|
|
|
@@ -1937,26 +1929,27 @@ var CHAPTER_SCHEMA = createSchema({
|
|
|
1937
1929
|
"data-paragraph-numbering-elements",
|
|
1938
1930
|
"data-paragraph-numbering-chapters"
|
|
1939
1931
|
],
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
{
|
|
1943
|
-
{
|
|
1944
|
-
{
|
|
1945
|
-
{
|
|
1946
|
-
{
|
|
1947
|
-
{
|
|
1948
|
-
{
|
|
1949
|
-
{
|
|
1950
|
-
{
|
|
1951
|
-
{
|
|
1952
|
-
{
|
|
1953
|
-
{
|
|
1954
|
-
{
|
|
1955
|
-
{
|
|
1956
|
-
{
|
|
1957
|
-
{
|
|
1958
|
-
{
|
|
1959
|
-
{
|
|
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 }
|
|
1960
1953
|
]
|
|
1961
1954
|
});
|
|
1962
1955
|
|
|
@@ -1975,8 +1968,8 @@ var EPIGRAPH_SCHEMA = createSchema({
|
|
|
1975
1968
|
defaultValue: "add-element"
|
|
1976
1969
|
}
|
|
1977
1970
|
],
|
|
1978
|
-
|
|
1979
|
-
|
|
1971
|
+
defaultChildCode: "para",
|
|
1972
|
+
allowedChildrenCodes: [{ code: "para", required: false }]
|
|
1980
1973
|
});
|
|
1981
1974
|
|
|
1982
1975
|
// src/schema/elementSchemas/elements/footnoteSection.ts
|
|
@@ -1993,10 +1986,10 @@ var FOOTNOTE_SECTION_SCHEMA = createSchema({
|
|
|
1993
1986
|
}
|
|
1994
1987
|
],
|
|
1995
1988
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
{
|
|
1999
|
-
{
|
|
1989
|
+
defaultChildCode: "para",
|
|
1990
|
+
allowedChildrenCodes: [
|
|
1991
|
+
{ code: "footnote", required: true },
|
|
1992
|
+
{ code: "title1", required: true }
|
|
2000
1993
|
]
|
|
2001
1994
|
});
|
|
2002
1995
|
|
|
@@ -2015,25 +2008,26 @@ var HEADING_SCHEMA = createSchema({
|
|
|
2015
2008
|
}
|
|
2016
2009
|
],
|
|
2017
2010
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
{
|
|
2021
|
-
{
|
|
2022
|
-
{
|
|
2023
|
-
{
|
|
2024
|
-
{
|
|
2025
|
-
{
|
|
2026
|
-
{
|
|
2027
|
-
{
|
|
2028
|
-
{
|
|
2029
|
-
{
|
|
2030
|
-
{
|
|
2031
|
-
{
|
|
2032
|
-
{
|
|
2033
|
-
{
|
|
2034
|
-
{
|
|
2035
|
-
{
|
|
2036
|
-
{
|
|
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 }
|
|
2037
2031
|
]
|
|
2038
2032
|
});
|
|
2039
2033
|
|
|
@@ -2044,14 +2038,14 @@ var INFO_SCHEMA = createSchema({
|
|
|
2044
2038
|
tag: INFO_TAG,
|
|
2045
2039
|
requiredAttributes: [...ID_ATTRS],
|
|
2046
2040
|
optionalAttributes: [],
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
{
|
|
2050
|
-
{
|
|
2051
|
-
{
|
|
2052
|
-
{
|
|
2053
|
-
{
|
|
2054
|
-
{
|
|
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 }
|
|
2055
2049
|
]
|
|
2056
2050
|
});
|
|
2057
2051
|
|
|
@@ -2062,10 +2056,10 @@ var POEM_SCHEMA = createSchema({
|
|
|
2062
2056
|
tag: POEM_TAG,
|
|
2063
2057
|
requiredAttributes: [...ID_ATTRS],
|
|
2064
2058
|
optionalAttributes: [...TRACK_CHANGES_ATTRS, "role"],
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
{
|
|
2068
|
-
{
|
|
2059
|
+
defaultChildCode: "line",
|
|
2060
|
+
allowedChildrenCodes: [
|
|
2061
|
+
{ code: "line", required: true },
|
|
2062
|
+
{ code: "source1", required: false }
|
|
2069
2063
|
]
|
|
2070
2064
|
});
|
|
2071
2065
|
|
|
@@ -2076,10 +2070,14 @@ var MATHPHRASE_SCHEMA = createSchema({
|
|
|
2076
2070
|
tag: MATHPHRASE_TAG,
|
|
2077
2071
|
requiredAttributes: [ELE_ID_ATTRIBUTE],
|
|
2078
2072
|
optionalAttributes: [],
|
|
2079
|
-
|
|
2080
|
-
{
|
|
2073
|
+
allowedChildrenCodes: [
|
|
2074
|
+
{ code: MATH_SCHEMA.code, required: true },
|
|
2075
|
+
{
|
|
2076
|
+
code: INSERTION_SCHEMA.code,
|
|
2077
|
+
required: false
|
|
2078
|
+
},
|
|
2081
2079
|
{
|
|
2082
|
-
|
|
2080
|
+
code: DELETION_SCHEMA.code,
|
|
2083
2081
|
required: false
|
|
2084
2082
|
}
|
|
2085
2083
|
]
|
|
@@ -2099,11 +2097,11 @@ var BIBLIODIV_SCHEMA = createSchema({
|
|
|
2099
2097
|
}
|
|
2100
2098
|
],
|
|
2101
2099
|
optionalAttributes: [],
|
|
2102
|
-
|
|
2103
|
-
{
|
|
2104
|
-
{
|
|
2105
|
-
{
|
|
2106
|
-
{
|
|
2100
|
+
allowedChildrenCodes: [
|
|
2101
|
+
{ code: "bibliodiv", required: false },
|
|
2102
|
+
{ code: "referenceBibliomixed", required: false },
|
|
2103
|
+
{ code: "para", required: false },
|
|
2104
|
+
{ code: "title1", required: false }
|
|
2107
2105
|
]
|
|
2108
2106
|
});
|
|
2109
2107
|
|
|
@@ -2127,11 +2125,11 @@ var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
|
|
|
2127
2125
|
}
|
|
2128
2126
|
],
|
|
2129
2127
|
optionalAttributes: [],
|
|
2130
|
-
|
|
2131
|
-
{
|
|
2132
|
-
{
|
|
2133
|
-
{
|
|
2134
|
-
{
|
|
2128
|
+
allowedChildrenCodes: [
|
|
2129
|
+
{ code: "bibliodiv", required: false },
|
|
2130
|
+
{ code: "referenceBibliomixed", required: false },
|
|
2131
|
+
{ code: "para", required: false },
|
|
2132
|
+
{ code: "title1", required: false }
|
|
2135
2133
|
]
|
|
2136
2134
|
});
|
|
2137
2135
|
|
|
@@ -2146,7 +2144,7 @@ var BIBLIOMIXED_SCHEMA = createSchema({
|
|
|
2146
2144
|
TRACK_CHANGES_ATTR_DATA_USERID,
|
|
2147
2145
|
TRACK_CHANGES_ATTR_DATA_DATE
|
|
2148
2146
|
],
|
|
2149
|
-
|
|
2147
|
+
allowedChildrenCodes: []
|
|
2150
2148
|
});
|
|
2151
2149
|
|
|
2152
2150
|
// src/schema/elementSchemas/elements/index.ts
|
|
@@ -2245,6 +2243,13 @@ var ELEMENT_SCHEMAS = {
|
|
|
2245
2243
|
affiliation: AFFILIATION_SCHEMA
|
|
2246
2244
|
};
|
|
2247
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
|
+
|
|
2248
2253
|
// src/schema/elementSchemas/inlineElements/footnoteLink.ts
|
|
2249
2254
|
var FOOTNOTE_LINK_SCHEMA = createSchema({
|
|
2250
2255
|
code: "footnote1",
|
|
@@ -2252,8 +2257,8 @@ var FOOTNOTE_LINK_SCHEMA = createSchema({
|
|
|
2252
2257
|
tag: FOOTNOTE_LINK_TAG,
|
|
2253
2258
|
requiredAttributes: [...ID_ATTRS],
|
|
2254
2259
|
optionalAttributes: ["linkend"],
|
|
2255
|
-
|
|
2256
|
-
|
|
2260
|
+
defaultChildCode: "sup",
|
|
2261
|
+
allowedChildrenCodes: [{ code: "sup", required: true }]
|
|
2257
2262
|
});
|
|
2258
2263
|
|
|
2259
2264
|
// src/schema/elementSchemas/inlineElements/inlineequation.ts
|
|
@@ -2275,12 +2280,7 @@ var INLINEEQUATION_SCHEMA = createSchema({
|
|
|
2275
2280
|
defaultValue: "added"
|
|
2276
2281
|
}
|
|
2277
2282
|
],
|
|
2278
|
-
|
|
2279
|
-
forbiddenElements: [
|
|
2280
|
-
{ code: QUERY_SCHEMA.code, resolveTo: "skip" },
|
|
2281
|
-
{ code: COMMENT_SCHEMA.code, resolveTo: "skip" },
|
|
2282
|
-
{ code: COMMENT_QUERY_SECTION_SCHEMA.code, resolveTo: "skip" }
|
|
2283
|
-
]
|
|
2283
|
+
allowedChildrenCodes: [{ code: "mathphrase", required: true }]
|
|
2284
2284
|
});
|
|
2285
2285
|
|
|
2286
2286
|
// src/schema/elementSchemas/inlineElements/link.ts
|
|
@@ -2299,7 +2299,7 @@ var LINK_SCHEMA = createSchema({
|
|
|
2299
2299
|
}
|
|
2300
2300
|
],
|
|
2301
2301
|
optionalAttributes: [],
|
|
2302
|
-
|
|
2302
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
2303
2303
|
});
|
|
2304
2304
|
|
|
2305
2305
|
// src/schema/elementSchemas/inlineElements/uri.ts
|
|
@@ -2309,7 +2309,17 @@ var URI_SCHEMA = createSchema({
|
|
|
2309
2309
|
tag: URI_TAG,
|
|
2310
2310
|
requiredAttributes: [...ID_ATTRS],
|
|
2311
2311
|
optionalAttributes: ["linkend"],
|
|
2312
|
-
|
|
2312
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
2313
|
+
});
|
|
2314
|
+
|
|
2315
|
+
// src/schema/elementSchemas/inlineElements/phrase.ts
|
|
2316
|
+
var PHRASE_SCHEMA = createSchema({
|
|
2317
|
+
code: "phrase",
|
|
2318
|
+
kind: "inline",
|
|
2319
|
+
tag: PHRASE_TAG,
|
|
2320
|
+
requiredAttributes: [...ID_ATTRS, "xml:lang"],
|
|
2321
|
+
optionalAttributes: [],
|
|
2322
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
2313
2323
|
});
|
|
2314
2324
|
|
|
2315
2325
|
// src/schema/elementSchemas/inlineElements/index.ts
|
|
@@ -2317,7 +2327,8 @@ var INLINE_ELEMENT_SCHEMAS = {
|
|
|
2317
2327
|
uri: URI_SCHEMA,
|
|
2318
2328
|
footnote1: FOOTNOTE_LINK_SCHEMA,
|
|
2319
2329
|
link: LINK_SCHEMA,
|
|
2320
|
-
inlineequation: INLINEEQUATION_SCHEMA
|
|
2330
|
+
inlineequation: INLINEEQUATION_SCHEMA,
|
|
2331
|
+
phrase: PHRASE_SCHEMA
|
|
2321
2332
|
};
|
|
2322
2333
|
|
|
2323
2334
|
// src/schema/schemas.ts
|
|
@@ -2448,7 +2459,8 @@ var ElementLabel = {
|
|
|
2448
2459
|
footnote1: "Footnote",
|
|
2449
2460
|
inlineequation: "Inline Equation",
|
|
2450
2461
|
link: "Link",
|
|
2451
|
-
uri: "URI"
|
|
2462
|
+
uri: "URI",
|
|
2463
|
+
phrase: "Phrase"
|
|
2452
2464
|
};
|
|
2453
2465
|
|
|
2454
2466
|
// src/schema/shared/ignoredElements.ts
|
|
@@ -2459,6 +2471,9 @@ var IGNORED_ELEMENT_SELECTORS = [
|
|
|
2459
2471
|
"span.missLink",
|
|
2460
2472
|
"span.ref-drag"
|
|
2461
2473
|
];
|
|
2474
|
+
var IGNORED_VALIDATION_ELEMENT_SELECTORS = [
|
|
2475
|
+
"referenceBibliomixed"
|
|
2476
|
+
];
|
|
2462
2477
|
|
|
2463
2478
|
// src/schema/shared/ignoredAttributes.ts
|
|
2464
2479
|
var IGNORED_ATTRIBUTES = [
|
|
@@ -2475,7 +2490,8 @@ var IGNORED_ATTRIBUTES = [
|
|
|
2475
2490
|
"translate",
|
|
2476
2491
|
"lang",
|
|
2477
2492
|
"dir",
|
|
2478
|
-
"hidden"
|
|
2493
|
+
"hidden",
|
|
2494
|
+
"data-gramm"
|
|
2479
2495
|
];
|
|
2480
2496
|
var IGNORED_ATTRIBUTES_STARTS_WITH = ["er-", "er_", "drop", "drag"];
|
|
2481
2497
|
|
|
@@ -2484,13 +2500,8 @@ var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute) |
|
|
|
2484
2500
|
(startsWith) => attribute.startsWith(startsWith)
|
|
2485
2501
|
);
|
|
2486
2502
|
var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
|
|
2503
|
+
var isIgnoredValidation = (code) => IGNORED_VALIDATION_ELEMENT_SELECTORS.includes(code);
|
|
2487
2504
|
var findSchemaByCode = (code) => SCHEMAS[code];
|
|
2488
|
-
var findSchemaByTagName = (tagName) => {
|
|
2489
|
-
const candidates = Object.values(SCHEMAS).filter(
|
|
2490
|
-
(schema) => schema.tag === tagName.toUpperCase()
|
|
2491
|
-
);
|
|
2492
|
-
return candidates;
|
|
2493
|
-
};
|
|
2494
2505
|
var findSchemaByElement = (element) => {
|
|
2495
2506
|
const tagName = element.tagName.toUpperCase();
|
|
2496
2507
|
const isInsertion = element.classList.contains("ins");
|
|
@@ -2522,8 +2533,6 @@ var findSchemaByElement = (element) => {
|
|
|
2522
2533
|
return findSchemaByCode("footnoteSection");
|
|
2523
2534
|
}
|
|
2524
2535
|
}
|
|
2525
|
-
const candidates = findSchemaByTagName(element.tagName.toUpperCase());
|
|
2526
|
-
return candidates[0];
|
|
2527
2536
|
};
|
|
2528
2537
|
var isAttributeRestricted = (attr) => typeof attr !== "string";
|
|
2529
2538
|
var getAttributeName = (attribute) => typeof attribute === "string" ? attribute.toLowerCase() : attribute.name.toLowerCase();
|
|
@@ -2761,7 +2770,7 @@ var validateAttributes = (element, schema) => {
|
|
|
2761
2770
|
};
|
|
2762
2771
|
|
|
2763
2772
|
// src/validation/validateChildren.ts
|
|
2764
|
-
var validateElementAgainstSchema = (element, schema
|
|
2773
|
+
var validateElementAgainstSchema = (element, schema) => {
|
|
2765
2774
|
const errors = [];
|
|
2766
2775
|
if (element.tagName.toUpperCase() !== schema.tag) {
|
|
2767
2776
|
addValidationIssue(errors, {
|
|
@@ -2773,20 +2782,19 @@ var validateElementAgainstSchema = (element, schema, inheritedForbiddenScope) =>
|
|
|
2773
2782
|
});
|
|
2774
2783
|
}
|
|
2775
2784
|
errors.push(...validateAttributes(element, schema));
|
|
2776
|
-
errors.push(...validateChildren(element, schema
|
|
2785
|
+
errors.push(...validateChildren(element, schema));
|
|
2777
2786
|
return errors;
|
|
2778
2787
|
};
|
|
2779
|
-
var validateChildren = (element, schema
|
|
2788
|
+
var validateChildren = (element, schema) => {
|
|
2780
2789
|
const errors = [];
|
|
2781
2790
|
const childElements = [...element.children].filter(
|
|
2782
2791
|
(child) => !isIgnoredElement(child)
|
|
2783
2792
|
);
|
|
2784
|
-
const allowedChildren = [...schema.
|
|
2793
|
+
const allowedChildren = [...schema.allowedChildrenCodes];
|
|
2785
2794
|
if (schema.kind === "atom") {
|
|
2786
2795
|
return errors;
|
|
2787
2796
|
}
|
|
2788
2797
|
for (const child of childElements) {
|
|
2789
|
-
const childTag = child.tagName.toUpperCase();
|
|
2790
2798
|
const childSchema = findSchemaByElement(child);
|
|
2791
2799
|
if (!childSchema) {
|
|
2792
2800
|
addValidationIssue(errors, {
|
|
@@ -2798,25 +2806,8 @@ var validateChildren = (element, schema, inheritedForbiddenScope) => {
|
|
|
2798
2806
|
});
|
|
2799
2807
|
continue;
|
|
2800
2808
|
}
|
|
2801
|
-
const forbiddenScope = [
|
|
2802
|
-
...inheritedForbiddenScope || [],
|
|
2803
|
-
...childSchema.forbiddenElements || []
|
|
2804
|
-
];
|
|
2805
|
-
const forbiddenChild = forbiddenScope.find(
|
|
2806
|
-
(element2) => element2.code === childSchema.code
|
|
2807
|
-
);
|
|
2808
|
-
if (forbiddenChild) {
|
|
2809
|
-
addValidationIssue(errors, {
|
|
2810
|
-
store: getStore(child),
|
|
2811
|
-
title: `Forbidden element ${child.tagName}`,
|
|
2812
|
-
level: "blocker",
|
|
2813
|
-
kind: "forbidden",
|
|
2814
|
-
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.`
|
|
2815
|
-
});
|
|
2816
|
-
continue;
|
|
2817
|
-
}
|
|
2818
2809
|
const allowedChild = allowedChildren.find(
|
|
2819
|
-
(candidate) => candidate.
|
|
2810
|
+
(candidate) => candidate.code === childSchema.code
|
|
2820
2811
|
);
|
|
2821
2812
|
if (!allowedChild) {
|
|
2822
2813
|
addValidationIssue(errors, {
|
|
@@ -2828,32 +2819,28 @@ var validateChildren = (element, schema, inheritedForbiddenScope) => {
|
|
|
2828
2819
|
});
|
|
2829
2820
|
continue;
|
|
2830
2821
|
}
|
|
2831
|
-
errors.push(
|
|
2832
|
-
...validateElementAgainstSchema(
|
|
2833
|
-
child,
|
|
2834
|
-
childSchema,
|
|
2835
|
-
new Set(forbiddenScope)
|
|
2836
|
-
)
|
|
2837
|
-
);
|
|
2822
|
+
errors.push(...validateElementAgainstSchema(child, childSchema));
|
|
2838
2823
|
}
|
|
2839
2824
|
for (const allowedChild of allowedChildren) {
|
|
2840
2825
|
if (!allowedChild.required) {
|
|
2841
2826
|
continue;
|
|
2842
2827
|
}
|
|
2843
|
-
const hasChild = childElements.some(
|
|
2844
|
-
|
|
2845
|
-
|
|
2828
|
+
const hasChild = childElements.some((child) => {
|
|
2829
|
+
const childSchema = findSchemaByElement(child);
|
|
2830
|
+
return childSchema?.code === allowedChild.code;
|
|
2831
|
+
});
|
|
2846
2832
|
if (!hasChild) {
|
|
2833
|
+
const requiredChildLabel = ElementLabel[allowedChild.code];
|
|
2847
2834
|
addValidationIssue(errors, {
|
|
2848
2835
|
store: getStore(element),
|
|
2849
|
-
title: `Missing required child element ${
|
|
2836
|
+
title: `Missing required child element ${requiredChildLabel}`,
|
|
2850
2837
|
level: "warning",
|
|
2851
2838
|
kind: "missing",
|
|
2852
|
-
description: `The child element ${
|
|
2839
|
+
description: `The child element ${requiredChildLabel} is required but not present.`
|
|
2853
2840
|
});
|
|
2854
2841
|
}
|
|
2855
2842
|
}
|
|
2856
|
-
if (schema.
|
|
2843
|
+
if (schema.allowedChildrenCodes.size === 0 && childElements.length > 0) {
|
|
2857
2844
|
addValidationIssue(errors, {
|
|
2858
2845
|
store: getStore(element),
|
|
2859
2846
|
title: "Atom element cannot contain child elements",
|
|
@@ -2912,13 +2899,7 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
|
|
|
2912
2899
|
const schema = findSchemaByElement(element);
|
|
2913
2900
|
if (schema) {
|
|
2914
2901
|
if (schemasToValidateAgainst.includes(schema.code)) {
|
|
2915
|
-
errors.push(
|
|
2916
|
-
...validateElementAgainstSchema(
|
|
2917
|
-
element,
|
|
2918
|
-
schema,
|
|
2919
|
-
schema.forbiddenElements
|
|
2920
|
-
)
|
|
2921
|
-
);
|
|
2902
|
+
errors.push(...validateElementAgainstSchema(element, schema));
|
|
2922
2903
|
}
|
|
2923
2904
|
const role = element.getAttribute("role") || "";
|
|
2924
2905
|
const linkableRoles = getLinkableRoles();
|
|
@@ -2927,11 +2908,13 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
|
|
|
2927
2908
|
}
|
|
2928
2909
|
if (schema.tag === BIBLIOMIXED_SCHEMA.tag) {
|
|
2929
2910
|
errors.push(...validateReferenceCited(element, linkElements));
|
|
2930
|
-
return errors;
|
|
2931
2911
|
}
|
|
2932
2912
|
if (schema.tag === FOOTNOTE_SCHEMA.tag) {
|
|
2933
2913
|
errors.push(...validateFootnoteCue(element, root));
|
|
2934
2914
|
}
|
|
2915
|
+
if (isIgnoredValidation(schema.code)) {
|
|
2916
|
+
return [];
|
|
2917
|
+
}
|
|
2935
2918
|
}
|
|
2936
2919
|
for (const child of Array.from(element.children)) {
|
|
2937
2920
|
errors.push(
|
|
@@ -2975,6 +2958,7 @@ var validateXml = (xml, elementsToLink, linkElements, schemasToValidateAgainst)
|
|
|
2975
2958
|
IGNORED_ATTRIBUTES,
|
|
2976
2959
|
IGNORED_ATTRIBUTES_STARTS_WITH,
|
|
2977
2960
|
IGNORED_ELEMENT_SELECTORS,
|
|
2961
|
+
IGNORED_VALIDATION_ELEMENT_SELECTORS,
|
|
2978
2962
|
INDENT_TYPE_ATTRIBUTE,
|
|
2979
2963
|
INLINE_ELEMENT_SCHEMAS,
|
|
2980
2964
|
LAYOUT_ATTRIBUTES,
|
|
@@ -2999,10 +2983,10 @@ var validateXml = (xml, elementsToLink, linkElements, schemasToValidateAgainst)
|
|
|
2999
2983
|
findAttributeDefinitionByName,
|
|
3000
2984
|
findSchemaByCode,
|
|
3001
2985
|
findSchemaByElement,
|
|
3002
|
-
findSchemaByTagName,
|
|
3003
2986
|
getAttributeName,
|
|
3004
2987
|
isAttributeRestricted,
|
|
3005
2988
|
isIgnoredAttribute,
|
|
3006
2989
|
isIgnoredElement,
|
|
2990
|
+
isIgnoredValidation,
|
|
3007
2991
|
validateXml
|
|
3008
2992
|
});
|