pro-editor-schema 0.1.198 → 0.1.200

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