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.mjs
CHANGED
|
@@ -5,9 +5,8 @@ var createSchema = ({
|
|
|
5
5
|
tag,
|
|
6
6
|
requiredAttributes,
|
|
7
7
|
optionalAttributes,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
forbiddenElements
|
|
8
|
+
defaultChildCode,
|
|
9
|
+
allowedChildrenCodes
|
|
11
10
|
}) => {
|
|
12
11
|
return {
|
|
13
12
|
code,
|
|
@@ -15,9 +14,8 @@ var createSchema = ({
|
|
|
15
14
|
tag,
|
|
16
15
|
requiredAttributes,
|
|
17
16
|
optionalAttributes,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
forbiddenElements: new Set(forbiddenElements)
|
|
17
|
+
defaultChildCode,
|
|
18
|
+
allowedChildrenCodes: new Set(allowedChildrenCodes)
|
|
21
19
|
};
|
|
22
20
|
};
|
|
23
21
|
|
|
@@ -60,6 +58,26 @@ var ELE_ID_ATTRIBUTE = "ele-id";
|
|
|
60
58
|
var STORE_ATTRIBUTE = "store";
|
|
61
59
|
var ID_ATTRS = [STORE_ATTRIBUTE, ELE_ID_ATTRIBUTE];
|
|
62
60
|
|
|
61
|
+
// src/schema/shared/allowedAtomsChildren.ts
|
|
62
|
+
var ATOM_CODES_ALLOWED_CHILDREN = [
|
|
63
|
+
{ code: "indexterm", required: false },
|
|
64
|
+
{ code: "b", required: false },
|
|
65
|
+
{ code: "i", required: false },
|
|
66
|
+
{ code: "u", required: false },
|
|
67
|
+
{ code: "sc", required: false },
|
|
68
|
+
{ code: "emphasis", required: false },
|
|
69
|
+
{ code: "strike", required: false },
|
|
70
|
+
{ code: "sub", required: false },
|
|
71
|
+
{ code: "sup", required: false },
|
|
72
|
+
{ code: "highlightmark", required: false },
|
|
73
|
+
{ code: "insertion", required: false },
|
|
74
|
+
{ code: "deletion", required: false },
|
|
75
|
+
{ code: "commentQuerySection", required: false },
|
|
76
|
+
{ code: "comment", required: false },
|
|
77
|
+
{ code: "query", required: false },
|
|
78
|
+
{ code: "referenceMark", required: false }
|
|
79
|
+
];
|
|
80
|
+
|
|
63
81
|
// src/schema/elementSchemas/atoms/atomTags.ts
|
|
64
82
|
var B_TAG = "B";
|
|
65
83
|
var I_TAG = "I";
|
|
@@ -84,24 +102,6 @@ var BOOKMARK_TAG = "BOOKMARK";
|
|
|
84
102
|
var SEE_TAG = "SEE";
|
|
85
103
|
var REFERENCE_MARK_TAG = "REFERENCE";
|
|
86
104
|
|
|
87
|
-
// src/schema/shared/allowedAtomsChildren.ts
|
|
88
|
-
var ATOM_TAGS_ALLOWED_CHILDREN = [
|
|
89
|
-
{ tagName: INDEXTERM_TAG, required: false },
|
|
90
|
-
{ tagName: B_TAG, required: false },
|
|
91
|
-
{ tagName: I_TAG, required: false },
|
|
92
|
-
{ tagName: U_TAG, required: false },
|
|
93
|
-
{ tagName: SC_TAG, required: false },
|
|
94
|
-
{ tagName: EMPHASIS_TAG, required: false },
|
|
95
|
-
{ tagName: STRIKE_TAG, required: false },
|
|
96
|
-
{ tagName: SUB_TAG, required: false },
|
|
97
|
-
{ tagName: SUP_TAG, required: false },
|
|
98
|
-
{ tagName: HIGHLIGHTMARK_TAG, required: false },
|
|
99
|
-
{ tagName: SPAN_TAG, required: false },
|
|
100
|
-
{ tagName: COMMENT_TAG, required: false },
|
|
101
|
-
{ tagName: QUERY_TAG, required: false },
|
|
102
|
-
{ tagName: REFERENCE_MARK_TAG, required: false }
|
|
103
|
-
];
|
|
104
|
-
|
|
105
105
|
// src/schema/elementSchemas/atoms/b.ts
|
|
106
106
|
var B_SCHEMA = createSchema({
|
|
107
107
|
code: "b",
|
|
@@ -109,7 +109,7 @@ var B_SCHEMA = createSchema({
|
|
|
109
109
|
tag: B_TAG,
|
|
110
110
|
requiredAttributes: [...ID_ATTRS],
|
|
111
111
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
112
|
-
|
|
112
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
// src/schema/elementSchemas/atoms/commentQuerySection.ts
|
|
@@ -119,21 +119,16 @@ var COMMENT_QUERY_SECTION_SCHEMA = createSchema({
|
|
|
119
119
|
code: "commentQuerySection",
|
|
120
120
|
requiredAttributes: [...ID_ATTRS, "id"],
|
|
121
121
|
optionalAttributes: [...TRACK_CHANGES_ATTRS, "title"],
|
|
122
|
-
|
|
122
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
// src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
|
|
126
|
-
var FOOTNOTE_LINK_TAG = "FOOTNOTE1";
|
|
127
|
-
var INLINEEQUATION_TAG = "INLINEEQUATION";
|
|
128
|
-
var LINK_TAG = "LINK1";
|
|
129
|
-
var URI_TAG = "URI";
|
|
130
|
-
|
|
131
125
|
// src/schema/shared/allowedInlineChildren.ts
|
|
132
|
-
var
|
|
133
|
-
{
|
|
134
|
-
{
|
|
135
|
-
{
|
|
136
|
-
{
|
|
126
|
+
var INLINE_ELEMENT_CODES_ALLOWED_CHILDREN = [
|
|
127
|
+
{ code: "footnote1", required: false },
|
|
128
|
+
{ code: "inlineequation", required: false },
|
|
129
|
+
{ code: "link", required: false },
|
|
130
|
+
{ code: "uri", required: false },
|
|
131
|
+
{ code: "phrase", required: false }
|
|
137
132
|
];
|
|
138
133
|
|
|
139
134
|
// src/schema/elementSchemas/atoms/deletion.ts
|
|
@@ -143,9 +138,9 @@ var DELETION_SCHEMA = createSchema({
|
|
|
143
138
|
tag: SPAN_TAG,
|
|
144
139
|
requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
|
|
145
140
|
optionalAttributes: [],
|
|
146
|
-
|
|
147
|
-
...
|
|
148
|
-
...
|
|
141
|
+
allowedChildrenCodes: [
|
|
142
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
143
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
149
144
|
]
|
|
150
145
|
});
|
|
151
146
|
|
|
@@ -163,7 +158,7 @@ var EMPHASIS_SCHEMA = createSchema({
|
|
|
163
158
|
defaultValue: "lowercase"
|
|
164
159
|
}
|
|
165
160
|
],
|
|
166
|
-
|
|
161
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
167
162
|
});
|
|
168
163
|
|
|
169
164
|
// src/schema/elementSchemas/atoms/highlightmark.ts
|
|
@@ -173,7 +168,7 @@ var HIGHLIGHTMARK_SCHEMA = createSchema({
|
|
|
173
168
|
tag: HIGHLIGHTMARK_TAG,
|
|
174
169
|
requiredAttributes: [...ID_ATTRS],
|
|
175
170
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
176
|
-
|
|
171
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
177
172
|
});
|
|
178
173
|
|
|
179
174
|
// src/schema/elementSchemas/atoms/i.ts
|
|
@@ -183,7 +178,7 @@ var I_SCHEMA = createSchema({
|
|
|
183
178
|
tag: I_TAG,
|
|
184
179
|
requiredAttributes: [...ID_ATTRS],
|
|
185
180
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
186
|
-
|
|
181
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
187
182
|
});
|
|
188
183
|
|
|
189
184
|
// src/schema/elementSchemas/atoms/insertion.ts
|
|
@@ -193,9 +188,9 @@ var INSERTION_SCHEMA = createSchema({
|
|
|
193
188
|
tag: SPAN_TAG,
|
|
194
189
|
requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
|
|
195
190
|
optionalAttributes: [],
|
|
196
|
-
|
|
197
|
-
...
|
|
198
|
-
...
|
|
191
|
+
allowedChildrenCodes: [
|
|
192
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
193
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
199
194
|
]
|
|
200
195
|
});
|
|
201
196
|
|
|
@@ -206,7 +201,7 @@ var SC_SCHEMA = createSchema({
|
|
|
206
201
|
tag: SC_TAG,
|
|
207
202
|
requiredAttributes: [...ID_ATTRS],
|
|
208
203
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
209
|
-
|
|
204
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
210
205
|
});
|
|
211
206
|
|
|
212
207
|
// src/schema/elementSchemas/atoms/strike.ts
|
|
@@ -216,7 +211,7 @@ var STRIKE_SCHEMA = createSchema({
|
|
|
216
211
|
tag: STRIKE_TAG,
|
|
217
212
|
requiredAttributes: [...ID_ATTRS],
|
|
218
213
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
219
|
-
|
|
214
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
220
215
|
});
|
|
221
216
|
|
|
222
217
|
// src/schema/elementSchemas/atoms/sub.ts
|
|
@@ -226,7 +221,7 @@ var SUB_SCHEMA = createSchema({
|
|
|
226
221
|
tag: SUB_TAG,
|
|
227
222
|
requiredAttributes: [...ID_ATTRS],
|
|
228
223
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
229
|
-
|
|
224
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
230
225
|
});
|
|
231
226
|
|
|
232
227
|
// src/schema/elementSchemas/atoms/sup.ts
|
|
@@ -236,7 +231,7 @@ var SUP_SCHEMA = createSchema({
|
|
|
236
231
|
tag: SUP_TAG,
|
|
237
232
|
requiredAttributes: [...ID_ATTRS],
|
|
238
233
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
239
|
-
|
|
234
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
240
235
|
});
|
|
241
236
|
|
|
242
237
|
// src/schema/elementSchemas/atoms/u.ts
|
|
@@ -246,7 +241,7 @@ var U_SCHEMA = createSchema({
|
|
|
246
241
|
tag: U_TAG,
|
|
247
242
|
requiredAttributes: [...ID_ATTRS],
|
|
248
243
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
249
|
-
|
|
244
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
250
245
|
});
|
|
251
246
|
|
|
252
247
|
// src/schema/elementSchemas/atoms/content.ts
|
|
@@ -256,15 +251,15 @@ var CONTENT_SCHEMA = createSchema({
|
|
|
256
251
|
tag: CONTENT_TAG,
|
|
257
252
|
requiredAttributes: [...ID_ATTRS],
|
|
258
253
|
optionalAttributes: [],
|
|
259
|
-
|
|
260
|
-
{
|
|
261
|
-
{
|
|
262
|
-
{
|
|
263
|
-
{
|
|
264
|
-
{
|
|
265
|
-
{
|
|
266
|
-
{
|
|
267
|
-
{
|
|
254
|
+
allowedChildrenCodes: [
|
|
255
|
+
{ code: "b", required: false },
|
|
256
|
+
{ code: "i", required: false },
|
|
257
|
+
{ code: "u", required: false },
|
|
258
|
+
{ code: "sc", required: false },
|
|
259
|
+
{ code: "emphasis", required: false },
|
|
260
|
+
{ code: "strike", required: false },
|
|
261
|
+
{ code: "sub", required: false },
|
|
262
|
+
{ code: "sup", required: false }
|
|
268
263
|
]
|
|
269
264
|
});
|
|
270
265
|
|
|
@@ -285,9 +280,9 @@ var COMMENT_SCHEMA = createSchema({
|
|
|
285
280
|
"markuser",
|
|
286
281
|
"marktime"
|
|
287
282
|
],
|
|
288
|
-
|
|
289
|
-
{
|
|
290
|
-
{
|
|
283
|
+
allowedChildrenCodes: [
|
|
284
|
+
{ code: "content", required: true },
|
|
285
|
+
{ code: "reply", required: false }
|
|
291
286
|
]
|
|
292
287
|
});
|
|
293
288
|
|
|
@@ -308,9 +303,9 @@ var QUERY_SCHEMA = createSchema({
|
|
|
308
303
|
"markuser",
|
|
309
304
|
"marktime"
|
|
310
305
|
],
|
|
311
|
-
|
|
312
|
-
{
|
|
313
|
-
{
|
|
306
|
+
allowedChildrenCodes: [
|
|
307
|
+
{ code: "content", required: true },
|
|
308
|
+
{ code: "reply", required: false }
|
|
314
309
|
]
|
|
315
310
|
});
|
|
316
311
|
|
|
@@ -331,7 +326,7 @@ var REPLY_SCHEMA = createSchema({
|
|
|
331
326
|
"markuser",
|
|
332
327
|
"marktime"
|
|
333
328
|
],
|
|
334
|
-
|
|
329
|
+
allowedChildrenCodes: [{ code: "content", required: true }]
|
|
335
330
|
});
|
|
336
331
|
|
|
337
332
|
// src/schema/elementSchemas/atoms/indexing/indexTermAttributes.ts
|
|
@@ -377,12 +372,7 @@ var BOOKMARK_SCHEMA = createSchema({
|
|
|
377
372
|
BOOKMARK_INDEX_POSITION_ATTRIBUTE
|
|
378
373
|
],
|
|
379
374
|
optionalAttributes: [],
|
|
380
|
-
|
|
381
|
-
{
|
|
382
|
-
tagName: SEE_TAG,
|
|
383
|
-
required: false
|
|
384
|
-
}
|
|
385
|
-
]
|
|
375
|
+
allowedChildrenCodes: [{ code: "see", required: false }]
|
|
386
376
|
});
|
|
387
377
|
|
|
388
378
|
// src/schema/elementSchemas/atoms/indexing/indexterm.ts
|
|
@@ -400,12 +390,12 @@ var INDEXTERM_SCHEMA = createSchema({
|
|
|
400
390
|
...ID_ATTRS
|
|
401
391
|
],
|
|
402
392
|
optionalAttributes: [],
|
|
403
|
-
|
|
404
|
-
{
|
|
405
|
-
{
|
|
406
|
-
{
|
|
407
|
-
{
|
|
408
|
-
{
|
|
393
|
+
allowedChildrenCodes: [
|
|
394
|
+
{ code: "primary", required: false },
|
|
395
|
+
{ code: "secondary", required: false },
|
|
396
|
+
{ code: "tertiary", required: false },
|
|
397
|
+
{ code: "quaternary", required: false },
|
|
398
|
+
{ code: "bookmark", required: false }
|
|
409
399
|
]
|
|
410
400
|
});
|
|
411
401
|
|
|
@@ -416,9 +406,9 @@ var PRIMARY_SCHEMA = createSchema({
|
|
|
416
406
|
tag: PRIMARY_TAG,
|
|
417
407
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
418
408
|
optionalAttributes: [],
|
|
419
|
-
|
|
420
|
-
...
|
|
421
|
-
{
|
|
409
|
+
allowedChildrenCodes: [
|
|
410
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
411
|
+
{ code: "see", required: false }
|
|
422
412
|
]
|
|
423
413
|
});
|
|
424
414
|
|
|
@@ -429,9 +419,9 @@ var QUATERNARY_SCHEMA = createSchema({
|
|
|
429
419
|
tag: QUATERNARY_TAG,
|
|
430
420
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
431
421
|
optionalAttributes: [],
|
|
432
|
-
|
|
433
|
-
...
|
|
434
|
-
{
|
|
422
|
+
allowedChildrenCodes: [
|
|
423
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
424
|
+
{ code: "see", required: false }
|
|
435
425
|
]
|
|
436
426
|
});
|
|
437
427
|
|
|
@@ -442,9 +432,9 @@ var SECONDARY_SCHEMA = createSchema({
|
|
|
442
432
|
tag: SECONDARY_TAG,
|
|
443
433
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
444
434
|
optionalAttributes: [],
|
|
445
|
-
|
|
446
|
-
...
|
|
447
|
-
{
|
|
435
|
+
allowedChildrenCodes: [
|
|
436
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
437
|
+
{ code: "see", required: false }
|
|
448
438
|
]
|
|
449
439
|
});
|
|
450
440
|
|
|
@@ -455,7 +445,7 @@ var SEE_SCHEMA = createSchema({
|
|
|
455
445
|
tag: SEE_TAG,
|
|
456
446
|
requiredAttributes: [...SEE_REQUIRED_ATTRIBUTES],
|
|
457
447
|
optionalAttributes: [],
|
|
458
|
-
|
|
448
|
+
allowedChildrenCodes: []
|
|
459
449
|
});
|
|
460
450
|
|
|
461
451
|
// src/schema/elementSchemas/atoms/indexing/tertiary.ts
|
|
@@ -465,9 +455,9 @@ var TERTIARY_SCHEMA = createSchema({
|
|
|
465
455
|
tag: TERTIARY_TAG,
|
|
466
456
|
requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
|
|
467
457
|
optionalAttributes: [],
|
|
468
|
-
|
|
469
|
-
...
|
|
470
|
-
{
|
|
458
|
+
allowedChildrenCodes: [
|
|
459
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
460
|
+
{ code: "see", required: false }
|
|
471
461
|
]
|
|
472
462
|
});
|
|
473
463
|
|
|
@@ -488,7 +478,7 @@ var REFERENCE_MARK_SCHEMA = createSchema({
|
|
|
488
478
|
}
|
|
489
479
|
],
|
|
490
480
|
optionalAttributes: [],
|
|
491
|
-
|
|
481
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
492
482
|
});
|
|
493
483
|
|
|
494
484
|
// src/schema/elementSchemas/atoms/index.ts
|
|
@@ -619,9 +609,9 @@ var AUTHORGROUP_SCHEMA = createSchema({
|
|
|
619
609
|
tag: AUTHORGROUP_TAG,
|
|
620
610
|
requiredAttributes: [...ID_ATTRS],
|
|
621
611
|
optionalAttributes: [],
|
|
622
|
-
|
|
623
|
-
{
|
|
624
|
-
{
|
|
612
|
+
allowedChildrenCodes: [
|
|
613
|
+
{ code: "author", required: false },
|
|
614
|
+
{ code: "punc", required: false }
|
|
625
615
|
]
|
|
626
616
|
});
|
|
627
617
|
|
|
@@ -632,13 +622,13 @@ var AUTHOR_SCHEMA = createSchema({
|
|
|
632
622
|
tag: AUTHOR_TAG,
|
|
633
623
|
requiredAttributes: [...ID_ATTRS],
|
|
634
624
|
optionalAttributes: [],
|
|
635
|
-
|
|
636
|
-
{
|
|
637
|
-
{
|
|
638
|
-
{
|
|
639
|
-
{
|
|
640
|
-
{
|
|
641
|
-
{
|
|
625
|
+
allowedChildrenCodes: [
|
|
626
|
+
{ code: "personname", required: true },
|
|
627
|
+
{ code: "olink", required: true },
|
|
628
|
+
{ code: "affiliation", required: false },
|
|
629
|
+
{ code: "degrees", required: false },
|
|
630
|
+
{ code: "punc", required: false },
|
|
631
|
+
{ code: "email", required: false }
|
|
642
632
|
]
|
|
643
633
|
});
|
|
644
634
|
|
|
@@ -649,7 +639,7 @@ var OLINK_SCHEMA = createSchema({
|
|
|
649
639
|
tag: OLINK_TAG,
|
|
650
640
|
requiredAttributes: [...ID_ATTRS],
|
|
651
641
|
optionalAttributes: [],
|
|
652
|
-
|
|
642
|
+
allowedChildrenCodes: []
|
|
653
643
|
});
|
|
654
644
|
|
|
655
645
|
// src/schema/elementSchemas/elements/authors/personname.ts
|
|
@@ -659,10 +649,10 @@ var PERSONNAME_SCHEMA = createSchema({
|
|
|
659
649
|
tag: PERSONNAME_TAG,
|
|
660
650
|
requiredAttributes: [...ID_ATTRS],
|
|
661
651
|
optionalAttributes: [],
|
|
662
|
-
|
|
663
|
-
{
|
|
664
|
-
{
|
|
665
|
-
{
|
|
652
|
+
allowedChildrenCodes: [
|
|
653
|
+
{ code: "firstname", required: true },
|
|
654
|
+
{ code: "surname", required: true },
|
|
655
|
+
{ code: "honorific", required: false }
|
|
666
656
|
]
|
|
667
657
|
});
|
|
668
658
|
|
|
@@ -673,7 +663,7 @@ var FIRSTNAME_SCHEMA = createSchema({
|
|
|
673
663
|
tag: FIRSTNAME_TAG,
|
|
674
664
|
requiredAttributes: [...ID_ATTRS],
|
|
675
665
|
optionalAttributes: [],
|
|
676
|
-
|
|
666
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
677
667
|
});
|
|
678
668
|
|
|
679
669
|
// src/schema/elementSchemas/elements/authors/surname.ts
|
|
@@ -683,7 +673,7 @@ var SURNAME_SCHEMA = createSchema({
|
|
|
683
673
|
tag: SURNAME_TAG,
|
|
684
674
|
requiredAttributes: [...ID_ATTRS],
|
|
685
675
|
optionalAttributes: [],
|
|
686
|
-
|
|
676
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
687
677
|
});
|
|
688
678
|
|
|
689
679
|
// src/schema/elementSchemas/elements/authors/honorific.ts
|
|
@@ -693,7 +683,7 @@ var HONORIFIC_SCHEMA = createSchema({
|
|
|
693
683
|
tag: HONORIFIC_TAG,
|
|
694
684
|
requiredAttributes: [...ID_ATTRS],
|
|
695
685
|
optionalAttributes: [],
|
|
696
|
-
|
|
686
|
+
allowedChildrenCodes: []
|
|
697
687
|
});
|
|
698
688
|
|
|
699
689
|
// src/schema/elementSchemas/elements/authors/orgname.ts
|
|
@@ -703,7 +693,7 @@ var ORGNAME_SCHEMA = createSchema({
|
|
|
703
693
|
tag: ORGNAME_TAG,
|
|
704
694
|
requiredAttributes: [...ID_ATTRS],
|
|
705
695
|
optionalAttributes: [],
|
|
706
|
-
|
|
696
|
+
allowedChildrenCodes: []
|
|
707
697
|
});
|
|
708
698
|
|
|
709
699
|
// src/schema/elementSchemas/elements/authors/email.ts
|
|
@@ -713,7 +703,7 @@ var EMAIL_SCHEMA = createSchema({
|
|
|
713
703
|
tag: EMAIL_TAG,
|
|
714
704
|
requiredAttributes: [...ID_ATTRS],
|
|
715
705
|
optionalAttributes: [],
|
|
716
|
-
|
|
706
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
717
707
|
});
|
|
718
708
|
|
|
719
709
|
// src/schema/elementSchemas/elements/authors/org.ts
|
|
@@ -723,7 +713,7 @@ var ORG_SCHEMA = createSchema({
|
|
|
723
713
|
tag: ORG_TAG,
|
|
724
714
|
requiredAttributes: [...ID_ATTRS],
|
|
725
715
|
optionalAttributes: [],
|
|
726
|
-
|
|
716
|
+
allowedChildrenCodes: [{ code: "orgname", required: false }]
|
|
727
717
|
});
|
|
728
718
|
|
|
729
719
|
// src/schema/elementSchemas/elements/authors/affiliation.ts
|
|
@@ -733,7 +723,7 @@ var AFFILIATION_SCHEMA = createSchema({
|
|
|
733
723
|
tag: AFFILIATION_TAG,
|
|
734
724
|
requiredAttributes: [...ID_ATTRS],
|
|
735
725
|
optionalAttributes: [],
|
|
736
|
-
|
|
726
|
+
allowedChildrenCodes: [{ code: "org", required: false }]
|
|
737
727
|
});
|
|
738
728
|
|
|
739
729
|
// src/schema/elementSchemas/elements/degrees.ts
|
|
@@ -743,7 +733,7 @@ var DEGREES_SCHEMA = createSchema({
|
|
|
743
733
|
tag: DEGREES_TAG,
|
|
744
734
|
requiredAttributes: [...ID_ATTRS],
|
|
745
735
|
optionalAttributes: [],
|
|
746
|
-
|
|
736
|
+
allowedChildrenCodes: []
|
|
747
737
|
});
|
|
748
738
|
|
|
749
739
|
// src/schema/elementSchemas/elements/dialogue/line.ts
|
|
@@ -759,7 +749,10 @@ var LINE_SCHEMA = createSchema({
|
|
|
759
749
|
defaultValue: "add-element"
|
|
760
750
|
}
|
|
761
751
|
],
|
|
762
|
-
|
|
752
|
+
allowedChildrenCodes: [
|
|
753
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
754
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
755
|
+
]
|
|
763
756
|
});
|
|
764
757
|
|
|
765
758
|
// src/schema/elementSchemas/elements/dialogue/speaker.ts
|
|
@@ -775,7 +768,7 @@ var SPEAKER_SCHEMA = createSchema({
|
|
|
775
768
|
defaultValue: "add-element"
|
|
776
769
|
}
|
|
777
770
|
],
|
|
778
|
-
|
|
771
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
779
772
|
});
|
|
780
773
|
|
|
781
774
|
// src/schema/elementSchemas/elements/dialogue/dialogue.ts
|
|
@@ -792,9 +785,9 @@ var DIALOGUE_SCHEMA = createSchema({
|
|
|
792
785
|
defaultValue: "add-element"
|
|
793
786
|
}
|
|
794
787
|
],
|
|
795
|
-
|
|
796
|
-
{
|
|
797
|
-
{
|
|
788
|
+
allowedChildrenCodes: [
|
|
789
|
+
{ code: "line", required: false },
|
|
790
|
+
{ code: "speaker", required: true }
|
|
798
791
|
]
|
|
799
792
|
});
|
|
800
793
|
|
|
@@ -817,47 +810,39 @@ var EQUATION_SCHEMA = createSchema({
|
|
|
817
810
|
defaultValue: "added"
|
|
818
811
|
}
|
|
819
812
|
],
|
|
820
|
-
|
|
821
|
-
{
|
|
822
|
-
{
|
|
823
|
-
tagName: CAPTION_TAG,
|
|
824
|
-
required: false
|
|
825
|
-
}
|
|
826
|
-
],
|
|
827
|
-
forbiddenElements: [
|
|
828
|
-
{ code: QUERY_SCHEMA.code, resolveTo: "skip" },
|
|
829
|
-
{ code: COMMENT_SCHEMA.code, resolveTo: "skip" },
|
|
830
|
-
{ code: COMMENT_QUERY_SECTION_SCHEMA.code, resolveTo: "skip" }
|
|
813
|
+
allowedChildrenCodes: [
|
|
814
|
+
{ code: "mathphrase", required: true },
|
|
815
|
+
{ code: "caption1", required: false }
|
|
831
816
|
]
|
|
832
817
|
});
|
|
833
818
|
|
|
834
819
|
// src/schema/shared/allowedMathChildren.ts
|
|
835
|
-
var
|
|
836
|
-
{
|
|
837
|
-
{
|
|
838
|
-
{
|
|
839
|
-
{
|
|
840
|
-
{
|
|
841
|
-
{
|
|
842
|
-
{
|
|
843
|
-
{
|
|
844
|
-
{
|
|
845
|
-
{
|
|
846
|
-
{
|
|
847
|
-
{
|
|
848
|
-
{
|
|
849
|
-
{
|
|
850
|
-
{
|
|
851
|
-
{
|
|
852
|
-
{
|
|
853
|
-
{
|
|
854
|
-
{
|
|
855
|
-
{
|
|
856
|
-
{
|
|
857
|
-
{
|
|
858
|
-
{
|
|
859
|
-
{
|
|
860
|
-
{
|
|
820
|
+
var MATH_PRESENTATION_CODES_ALLOWED_CHILDREN = [
|
|
821
|
+
{ code: "merror", required: false },
|
|
822
|
+
{ code: "mfrac", required: false },
|
|
823
|
+
{ code: "mi", required: false },
|
|
824
|
+
{ code: "mmultiscripts", required: false },
|
|
825
|
+
{ code: "mn", required: false },
|
|
826
|
+
{ code: "mo", required: false },
|
|
827
|
+
{ code: "mover", required: false },
|
|
828
|
+
{ code: "mpadded", required: false },
|
|
829
|
+
{ code: "mphantom", required: false },
|
|
830
|
+
{ code: "mprescripts", required: false },
|
|
831
|
+
{ code: "mroot", required: false },
|
|
832
|
+
{ code: "mrow", required: false },
|
|
833
|
+
{ code: "ms", required: false },
|
|
834
|
+
{ code: "mspace", required: false },
|
|
835
|
+
{ code: "msqrt", required: false },
|
|
836
|
+
{ code: "mstyle", required: false },
|
|
837
|
+
{ code: "msub", required: false },
|
|
838
|
+
{ code: "msubsup", required: false },
|
|
839
|
+
{ code: "msup", required: false },
|
|
840
|
+
{ code: "mtable", required: false },
|
|
841
|
+
{ code: "mtd", required: false },
|
|
842
|
+
{ code: "mtext", required: false },
|
|
843
|
+
{ code: "mtr", required: false },
|
|
844
|
+
{ code: "munder", required: false },
|
|
845
|
+
{ code: "munderover", required: false }
|
|
861
846
|
];
|
|
862
847
|
|
|
863
848
|
// src/schema/elementSchemas/elements/equation/math.ts
|
|
@@ -867,8 +852,8 @@ var MATH_SCHEMA = createSchema({
|
|
|
867
852
|
tag: MATH_TAG,
|
|
868
853
|
requiredAttributes: [],
|
|
869
854
|
optionalAttributes: ["xmlns", "display"],
|
|
870
|
-
|
|
871
|
-
|
|
855
|
+
defaultChildCode: "mi",
|
|
856
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
872
857
|
});
|
|
873
858
|
|
|
874
859
|
// src/schema/elementSchemas/elements/equation/merror.ts
|
|
@@ -878,7 +863,7 @@ var MERROR_SCHEMA = createSchema({
|
|
|
878
863
|
tag: MERROR_TAG,
|
|
879
864
|
requiredAttributes: [],
|
|
880
865
|
optionalAttributes: [],
|
|
881
|
-
|
|
866
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
882
867
|
});
|
|
883
868
|
|
|
884
869
|
// src/schema/elementSchemas/elements/equation/mfrac.ts
|
|
@@ -888,7 +873,7 @@ var MFRAC_SCHEMA = createSchema({
|
|
|
888
873
|
tag: MFRAC_TAG,
|
|
889
874
|
requiredAttributes: [],
|
|
890
875
|
optionalAttributes: ["denomalign", "linethickness", "numalign"],
|
|
891
|
-
|
|
876
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
892
877
|
});
|
|
893
878
|
|
|
894
879
|
// src/schema/elementSchemas/elements/equation/mi.ts
|
|
@@ -898,7 +883,7 @@ var MI_SCHEMA = createSchema({
|
|
|
898
883
|
tag: MI_TAG,
|
|
899
884
|
requiredAttributes: [],
|
|
900
885
|
optionalAttributes: ["mathvariant"],
|
|
901
|
-
|
|
886
|
+
allowedChildrenCodes: []
|
|
902
887
|
});
|
|
903
888
|
|
|
904
889
|
// src/schema/elementSchemas/elements/equation/mmultiscripts.ts
|
|
@@ -908,7 +893,7 @@ var MMULTISCRIPTS_SCHEMA = createSchema({
|
|
|
908
893
|
tag: MMULTISCRIPTS_TAG,
|
|
909
894
|
requiredAttributes: [],
|
|
910
895
|
optionalAttributes: ["subscriptshift", "superscriptshift"],
|
|
911
|
-
|
|
896
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
912
897
|
});
|
|
913
898
|
|
|
914
899
|
// src/schema/elementSchemas/elements/equation/mn.ts
|
|
@@ -918,7 +903,7 @@ var MN_SCHEMA = createSchema({
|
|
|
918
903
|
tag: MN_TAG,
|
|
919
904
|
requiredAttributes: [],
|
|
920
905
|
optionalAttributes: [],
|
|
921
|
-
|
|
906
|
+
allowedChildrenCodes: []
|
|
922
907
|
});
|
|
923
908
|
|
|
924
909
|
// src/schema/elementSchemas/elements/equation/mo.ts
|
|
@@ -941,7 +926,7 @@ var MO_SCHEMA = createSchema({
|
|
|
941
926
|
"stretchy",
|
|
942
927
|
"symmetric"
|
|
943
928
|
],
|
|
944
|
-
|
|
929
|
+
allowedChildrenCodes: []
|
|
945
930
|
});
|
|
946
931
|
|
|
947
932
|
// src/schema/elementSchemas/elements/equation/mover.ts
|
|
@@ -951,7 +936,7 @@ var MOVER_SCHEMA = createSchema({
|
|
|
951
936
|
tag: MOVER_TAG,
|
|
952
937
|
requiredAttributes: [],
|
|
953
938
|
optionalAttributes: ["accent"],
|
|
954
|
-
|
|
939
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
955
940
|
});
|
|
956
941
|
|
|
957
942
|
// src/schema/elementSchemas/elements/equation/mpadded.ts
|
|
@@ -960,14 +945,8 @@ var MPADDED_SCHEMA = createSchema({
|
|
|
960
945
|
kind: "element",
|
|
961
946
|
tag: MPADDED_TAG,
|
|
962
947
|
requiredAttributes: [],
|
|
963
|
-
optionalAttributes: [
|
|
964
|
-
|
|
965
|
-
"height",
|
|
966
|
-
"lspace",
|
|
967
|
-
"voffset",
|
|
968
|
-
"width"
|
|
969
|
-
],
|
|
970
|
-
allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
|
|
948
|
+
optionalAttributes: ["depth", "height", "lspace", "voffset", "width"],
|
|
949
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
971
950
|
});
|
|
972
951
|
|
|
973
952
|
// src/schema/elementSchemas/elements/equation/mphantom.ts
|
|
@@ -977,7 +956,7 @@ var MPHANTOM_SCHEMA = createSchema({
|
|
|
977
956
|
tag: MPHANTOM_TAG,
|
|
978
957
|
requiredAttributes: [],
|
|
979
958
|
optionalAttributes: [],
|
|
980
|
-
|
|
959
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
981
960
|
});
|
|
982
961
|
|
|
983
962
|
// src/schema/elementSchemas/elements/equation/mprescripts.ts
|
|
@@ -987,7 +966,7 @@ var MPRESCRIPTS_SCHEMA = createSchema({
|
|
|
987
966
|
tag: MPRESCRIPTS_TAG,
|
|
988
967
|
requiredAttributes: [],
|
|
989
968
|
optionalAttributes: [],
|
|
990
|
-
|
|
969
|
+
allowedChildrenCodes: []
|
|
991
970
|
});
|
|
992
971
|
|
|
993
972
|
// src/schema/elementSchemas/elements/equation/mroot.ts
|
|
@@ -997,7 +976,7 @@ var MROOT_SCHEMA = createSchema({
|
|
|
997
976
|
tag: MROOT_TAG,
|
|
998
977
|
requiredAttributes: [],
|
|
999
978
|
optionalAttributes: [],
|
|
1000
|
-
|
|
979
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1001
980
|
});
|
|
1002
981
|
|
|
1003
982
|
// src/schema/elementSchemas/elements/equation/mrow.ts
|
|
@@ -1007,7 +986,7 @@ var MROW_SCHEMA = createSchema({
|
|
|
1007
986
|
tag: MROW_TAG,
|
|
1008
987
|
requiredAttributes: [],
|
|
1009
988
|
optionalAttributes: [],
|
|
1010
|
-
|
|
989
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1011
990
|
});
|
|
1012
991
|
|
|
1013
992
|
// src/schema/elementSchemas/elements/equation/ms.ts
|
|
@@ -1017,7 +996,7 @@ var MS_SCHEMA = createSchema({
|
|
|
1017
996
|
tag: MS_TAG,
|
|
1018
997
|
requiredAttributes: [],
|
|
1019
998
|
optionalAttributes: ["lquote", "rquote"],
|
|
1020
|
-
|
|
999
|
+
allowedChildrenCodes: []
|
|
1021
1000
|
});
|
|
1022
1001
|
|
|
1023
1002
|
// src/schema/elementSchemas/elements/equation/mspace.ts
|
|
@@ -1027,7 +1006,7 @@ var MSPACE_SCHEMA = createSchema({
|
|
|
1027
1006
|
tag: MSPACE_TAG,
|
|
1028
1007
|
requiredAttributes: [],
|
|
1029
1008
|
optionalAttributes: ["depth", "height", "width"],
|
|
1030
|
-
|
|
1009
|
+
allowedChildrenCodes: []
|
|
1031
1010
|
});
|
|
1032
1011
|
|
|
1033
1012
|
// src/schema/elementSchemas/elements/equation/msqrt.ts
|
|
@@ -1037,7 +1016,7 @@ var MSQRT_SCHEMA = createSchema({
|
|
|
1037
1016
|
tag: MSQRT_TAG,
|
|
1038
1017
|
requiredAttributes: [],
|
|
1039
1018
|
optionalAttributes: [],
|
|
1040
|
-
|
|
1019
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1041
1020
|
});
|
|
1042
1021
|
|
|
1043
1022
|
// src/schema/elementSchemas/elements/equation/mstyle.ts
|
|
@@ -1055,7 +1034,7 @@ var MSTYLE_SCHEMA = createSchema({
|
|
|
1055
1034
|
"scriptminsize",
|
|
1056
1035
|
"scriptsizemultiplier"
|
|
1057
1036
|
],
|
|
1058
|
-
|
|
1037
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1059
1038
|
});
|
|
1060
1039
|
|
|
1061
1040
|
// src/schema/elementSchemas/elements/equation/msub.ts
|
|
@@ -1065,7 +1044,7 @@ var MSUB_SCHEMA = createSchema({
|
|
|
1065
1044
|
tag: MSUB_TAG,
|
|
1066
1045
|
requiredAttributes: [],
|
|
1067
1046
|
optionalAttributes: ["subscriptshift"],
|
|
1068
|
-
|
|
1047
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1069
1048
|
});
|
|
1070
1049
|
|
|
1071
1050
|
// src/schema/elementSchemas/elements/equation/msubsup.ts
|
|
@@ -1075,7 +1054,7 @@ var MSUBSUP_SCHEMA = createSchema({
|
|
|
1075
1054
|
tag: MSUBSUP_TAG,
|
|
1076
1055
|
requiredAttributes: [],
|
|
1077
1056
|
optionalAttributes: ["subscriptshift", "superscriptshift"],
|
|
1078
|
-
|
|
1057
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1079
1058
|
});
|
|
1080
1059
|
|
|
1081
1060
|
// src/schema/elementSchemas/elements/equation/msup.ts
|
|
@@ -1085,7 +1064,7 @@ var MSUP_SCHEMA = createSchema({
|
|
|
1085
1064
|
tag: MSUP_TAG,
|
|
1086
1065
|
requiredAttributes: [],
|
|
1087
1066
|
optionalAttributes: ["superscriptshift"],
|
|
1088
|
-
|
|
1067
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1089
1068
|
});
|
|
1090
1069
|
|
|
1091
1070
|
// src/schema/elementSchemas/elements/equation/mtable.ts
|
|
@@ -1108,7 +1087,7 @@ var MTABLE_SCHEMA = createSchema({
|
|
|
1108
1087
|
"rowspacing",
|
|
1109
1088
|
"width"
|
|
1110
1089
|
],
|
|
1111
|
-
|
|
1090
|
+
allowedChildrenCodes: [{ code: "mtr", required: false }]
|
|
1112
1091
|
});
|
|
1113
1092
|
|
|
1114
1093
|
// src/schema/elementSchemas/elements/equation/mtd.ts
|
|
@@ -1117,13 +1096,8 @@ var MTD_SCHEMA = createSchema({
|
|
|
1117
1096
|
kind: "element",
|
|
1118
1097
|
tag: MTD_TAG,
|
|
1119
1098
|
requiredAttributes: [],
|
|
1120
|
-
optionalAttributes: [
|
|
1121
|
-
|
|
1122
|
-
"columnspan",
|
|
1123
|
-
"rowalign",
|
|
1124
|
-
"rowspan"
|
|
1125
|
-
],
|
|
1126
|
-
allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
|
|
1099
|
+
optionalAttributes: ["columnalign", "columnspan", "rowalign", "rowspan"],
|
|
1100
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1127
1101
|
});
|
|
1128
1102
|
|
|
1129
1103
|
// src/schema/elementSchemas/elements/equation/mtext.ts
|
|
@@ -1133,7 +1107,7 @@ var MTEXT_SCHEMA = createSchema({
|
|
|
1133
1107
|
tag: MTEXT_TAG,
|
|
1134
1108
|
requiredAttributes: [],
|
|
1135
1109
|
optionalAttributes: ["mathvariant"],
|
|
1136
|
-
|
|
1110
|
+
allowedChildrenCodes: []
|
|
1137
1111
|
});
|
|
1138
1112
|
|
|
1139
1113
|
// src/schema/elementSchemas/elements/equation/mtr.ts
|
|
@@ -1143,7 +1117,7 @@ var MTR_SCHEMA = createSchema({
|
|
|
1143
1117
|
tag: MTR_TAG,
|
|
1144
1118
|
requiredAttributes: [],
|
|
1145
1119
|
optionalAttributes: ["columnalign", "rowalign"],
|
|
1146
|
-
|
|
1120
|
+
allowedChildrenCodes: [{ code: "mtd", required: false }]
|
|
1147
1121
|
});
|
|
1148
1122
|
|
|
1149
1123
|
// src/schema/elementSchemas/elements/equation/munder.ts
|
|
@@ -1153,7 +1127,7 @@ var MUNDER_SCHEMA = createSchema({
|
|
|
1153
1127
|
tag: MUNDER_TAG,
|
|
1154
1128
|
requiredAttributes: [],
|
|
1155
1129
|
optionalAttributes: ["accentunder"],
|
|
1156
|
-
|
|
1130
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1157
1131
|
});
|
|
1158
1132
|
|
|
1159
1133
|
// src/schema/elementSchemas/elements/equation/munderover.ts
|
|
@@ -1163,7 +1137,7 @@ var MUNDEROVER_SCHEMA = createSchema({
|
|
|
1163
1137
|
tag: MUNDEROVER_TAG,
|
|
1164
1138
|
requiredAttributes: [],
|
|
1165
1139
|
optionalAttributes: ["accent", "accentunder"],
|
|
1166
|
-
|
|
1140
|
+
allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
|
|
1167
1141
|
});
|
|
1168
1142
|
|
|
1169
1143
|
// src/schema/elementSchemas/elements/figure/img.ts
|
|
@@ -1184,7 +1158,7 @@ var IMG_SCHEMA = createSchema({
|
|
|
1184
1158
|
defaultValue: "inline-graphics"
|
|
1185
1159
|
}
|
|
1186
1160
|
],
|
|
1187
|
-
|
|
1161
|
+
allowedChildrenCodes: []
|
|
1188
1162
|
});
|
|
1189
1163
|
|
|
1190
1164
|
// src/schema/elementSchemas/elements/figure/alttext.ts
|
|
@@ -1194,7 +1168,7 @@ var ALTTEXT_SCHEMA = createSchema({
|
|
|
1194
1168
|
tag: ALTTEXT_TAG,
|
|
1195
1169
|
requiredAttributes: [],
|
|
1196
1170
|
optionalAttributes: [],
|
|
1197
|
-
|
|
1171
|
+
allowedChildrenCodes: [{ code: "content", required: false }]
|
|
1198
1172
|
});
|
|
1199
1173
|
|
|
1200
1174
|
// src/schema/elementSchemas/elements/figure/imageobject.ts
|
|
@@ -1204,9 +1178,9 @@ var IMAGEOBJECT_SCHEMA = createSchema({
|
|
|
1204
1178
|
tag: IMAGEOBJECT_TAG,
|
|
1205
1179
|
requiredAttributes: [...ID_ATTRS],
|
|
1206
1180
|
optionalAttributes: [],
|
|
1207
|
-
|
|
1208
|
-
{
|
|
1209
|
-
{
|
|
1181
|
+
allowedChildrenCodes: [
|
|
1182
|
+
{ code: "img", required: false },
|
|
1183
|
+
{ code: "alttext", required: false }
|
|
1210
1184
|
]
|
|
1211
1185
|
});
|
|
1212
1186
|
|
|
@@ -1217,7 +1191,7 @@ var MEDIAOBJECT_SCHEMA = createSchema({
|
|
|
1217
1191
|
tag: MEDIAOBJECT_TAG,
|
|
1218
1192
|
requiredAttributes: [...ID_ATTRS],
|
|
1219
1193
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1220
|
-
|
|
1194
|
+
allowedChildrenCodes: [{ code: "imageobject", required: false }]
|
|
1221
1195
|
});
|
|
1222
1196
|
|
|
1223
1197
|
// src/schema/elementSchemas/elements/figure/caption1.ts
|
|
@@ -1227,7 +1201,7 @@ var CAPTION_SCHEMA = createSchema({
|
|
|
1227
1201
|
tag: CAPTION_TAG,
|
|
1228
1202
|
requiredAttributes: [...ID_ATTRS],
|
|
1229
1203
|
optionalAttributes: [],
|
|
1230
|
-
|
|
1204
|
+
allowedChildrenCodes: [{ code: "para", required: false }]
|
|
1231
1205
|
});
|
|
1232
1206
|
|
|
1233
1207
|
// src/schema/elementSchemas/elements/figure/figsource.ts
|
|
@@ -1237,9 +1211,9 @@ var FIGSOURCE_SCHEMA = createSchema({
|
|
|
1237
1211
|
tag: FIGSOURCE_TAG,
|
|
1238
1212
|
requiredAttributes: [...ID_ATTRS],
|
|
1239
1213
|
optionalAttributes: [],
|
|
1240
|
-
|
|
1241
|
-
...
|
|
1242
|
-
...
|
|
1214
|
+
allowedChildrenCodes: [
|
|
1215
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1216
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1243
1217
|
]
|
|
1244
1218
|
});
|
|
1245
1219
|
|
|
@@ -1250,9 +1224,9 @@ var FIGNOTE_SCHEMA = createSchema({
|
|
|
1250
1224
|
tag: FIGNOTE_TAG,
|
|
1251
1225
|
requiredAttributes: [...ID_ATTRS],
|
|
1252
1226
|
optionalAttributes: [],
|
|
1253
|
-
|
|
1254
|
-
...
|
|
1255
|
-
...
|
|
1227
|
+
allowedChildrenCodes: [
|
|
1228
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1229
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1256
1230
|
]
|
|
1257
1231
|
});
|
|
1258
1232
|
|
|
@@ -1269,12 +1243,12 @@ var FIGURE_SCHEMA = createSchema({
|
|
|
1269
1243
|
"linkend_fig",
|
|
1270
1244
|
"data-anchor-id"
|
|
1271
1245
|
],
|
|
1272
|
-
|
|
1273
|
-
{
|
|
1274
|
-
{
|
|
1275
|
-
{
|
|
1276
|
-
{
|
|
1277
|
-
{
|
|
1246
|
+
allowedChildrenCodes: [
|
|
1247
|
+
{ code: "mediaobject", required: false },
|
|
1248
|
+
{ code: "label1", required: false },
|
|
1249
|
+
{ code: "caption1", required: false },
|
|
1250
|
+
{ code: "figsource", required: false },
|
|
1251
|
+
{ code: "fignote", required: false }
|
|
1278
1252
|
]
|
|
1279
1253
|
});
|
|
1280
1254
|
|
|
@@ -1294,9 +1268,9 @@ var FOOTNOTE_SCHEMA = createSchema({
|
|
|
1294
1268
|
}
|
|
1295
1269
|
],
|
|
1296
1270
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1297
|
-
|
|
1298
|
-
{
|
|
1299
|
-
{
|
|
1271
|
+
allowedChildrenCodes: [
|
|
1272
|
+
{ code: "footnoteno", required: false },
|
|
1273
|
+
{ code: "para", required: false }
|
|
1300
1274
|
]
|
|
1301
1275
|
});
|
|
1302
1276
|
|
|
@@ -1307,7 +1281,7 @@ var FOOTNOTE_NUMBER_SCHEMA = createSchema({
|
|
|
1307
1281
|
tag: FOOTNOTE_NUMBER_TAG,
|
|
1308
1282
|
requiredAttributes: [...ID_ATTRS],
|
|
1309
1283
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1310
|
-
|
|
1284
|
+
allowedChildrenCodes: []
|
|
1311
1285
|
});
|
|
1312
1286
|
|
|
1313
1287
|
// src/schema/elementSchemas/elements/informalfigure.ts
|
|
@@ -1317,9 +1291,9 @@ var INFORMALFIGURE_SCHEMA = createSchema({
|
|
|
1317
1291
|
tag: INFORMALFIGURE_TAG,
|
|
1318
1292
|
requiredAttributes: [...ID_ATTRS],
|
|
1319
1293
|
optionalAttributes: [...TRACK_CHANGES_ATTRS, "data-anchor-id"],
|
|
1320
|
-
|
|
1321
|
-
{
|
|
1322
|
-
{
|
|
1294
|
+
allowedChildrenCodes: [
|
|
1295
|
+
{ code: "mediaobject", required: false },
|
|
1296
|
+
{ code: "tag", required: false }
|
|
1323
1297
|
]
|
|
1324
1298
|
});
|
|
1325
1299
|
|
|
@@ -1337,10 +1311,10 @@ var KEYWORDSET_SCHEMA = createSchema({
|
|
|
1337
1311
|
}
|
|
1338
1312
|
],
|
|
1339
1313
|
optionalAttributes: [],
|
|
1340
|
-
|
|
1341
|
-
{
|
|
1342
|
-
{
|
|
1343
|
-
{
|
|
1314
|
+
allowedChildrenCodes: [
|
|
1315
|
+
{ code: "keyword", required: false },
|
|
1316
|
+
{ code: "title1", required: false },
|
|
1317
|
+
{ code: "punc", required: false }
|
|
1344
1318
|
]
|
|
1345
1319
|
});
|
|
1346
1320
|
|
|
@@ -1351,7 +1325,10 @@ var KEYWORD_SCHEMA = createSchema({
|
|
|
1351
1325
|
tag: KEYWORD_TAG,
|
|
1352
1326
|
requiredAttributes: [...ID_ATTRS],
|
|
1353
1327
|
optionalAttributes: ["data-pos"],
|
|
1354
|
-
|
|
1328
|
+
allowedChildrenCodes: [
|
|
1329
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1330
|
+
{ code: "phrase", required: false }
|
|
1331
|
+
]
|
|
1355
1332
|
});
|
|
1356
1333
|
|
|
1357
1334
|
// src/schema/elementSchemas/elements/keywords/punc.ts
|
|
@@ -1361,7 +1338,7 @@ var PUNC_SCHEMA = createSchema({
|
|
|
1361
1338
|
tag: PUNC_TAG,
|
|
1362
1339
|
requiredAttributes: [...ID_ATTRS],
|
|
1363
1340
|
optionalAttributes: ["data-role"],
|
|
1364
|
-
|
|
1341
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
1365
1342
|
});
|
|
1366
1343
|
|
|
1367
1344
|
// src/schema/elementSchemas/elements/label.ts
|
|
@@ -1378,12 +1355,9 @@ var LABEL_SCHEMA = createSchema({
|
|
|
1378
1355
|
defaultValue: "false"
|
|
1379
1356
|
}
|
|
1380
1357
|
],
|
|
1381
|
-
|
|
1382
|
-
...
|
|
1383
|
-
{
|
|
1384
|
-
tagName: LINK_TAG,
|
|
1385
|
-
required: false
|
|
1386
|
-
}
|
|
1358
|
+
allowedChildrenCodes: [
|
|
1359
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1360
|
+
{ code: "link", required: false }
|
|
1387
1361
|
]
|
|
1388
1362
|
});
|
|
1389
1363
|
|
|
@@ -1394,7 +1368,7 @@ var TOKEN_SCHEMA = createSchema({
|
|
|
1394
1368
|
tag: TOKEN_TAG,
|
|
1395
1369
|
requiredAttributes: [...ID_ATTRS],
|
|
1396
1370
|
optionalAttributes: [],
|
|
1397
|
-
|
|
1371
|
+
allowedChildrenCodes: []
|
|
1398
1372
|
});
|
|
1399
1373
|
|
|
1400
1374
|
// src/schema/elementSchemas/elements/list/li.ts
|
|
@@ -1418,11 +1392,11 @@ var LI_SCHEMA = createSchema({
|
|
|
1418
1392
|
defaultValue: "add-element"
|
|
1419
1393
|
}
|
|
1420
1394
|
],
|
|
1421
|
-
|
|
1422
|
-
{
|
|
1423
|
-
{
|
|
1424
|
-
{
|
|
1425
|
-
{
|
|
1395
|
+
allowedChildrenCodes: [
|
|
1396
|
+
{ code: "para", required: false },
|
|
1397
|
+
{ code: "tag", required: false },
|
|
1398
|
+
{ code: "ul", required: false },
|
|
1399
|
+
{ code: "ol", required: false }
|
|
1426
1400
|
]
|
|
1427
1401
|
});
|
|
1428
1402
|
|
|
@@ -1460,7 +1434,7 @@ var OL_SCHEMA = createSchema({
|
|
|
1460
1434
|
defaultValue: "disc"
|
|
1461
1435
|
}
|
|
1462
1436
|
],
|
|
1463
|
-
|
|
1437
|
+
allowedChildrenCodes: [{ code: "li", required: false }]
|
|
1464
1438
|
});
|
|
1465
1439
|
|
|
1466
1440
|
// src/schema/elementSchemas/elements/list/ul.ts
|
|
@@ -1501,7 +1475,7 @@ var UL_SCHEMA = createSchema({
|
|
|
1501
1475
|
defaultValue: "disc"
|
|
1502
1476
|
}
|
|
1503
1477
|
],
|
|
1504
|
-
|
|
1478
|
+
allowedChildrenCodes: [{ code: "li", required: false }]
|
|
1505
1479
|
});
|
|
1506
1480
|
|
|
1507
1481
|
// src/schema/elementSchemas/elements/para.ts
|
|
@@ -1517,17 +1491,17 @@ var PARA_SCHEMA = createSchema({
|
|
|
1517
1491
|
"role",
|
|
1518
1492
|
"data-pos"
|
|
1519
1493
|
],
|
|
1520
|
-
|
|
1521
|
-
...
|
|
1522
|
-
...
|
|
1523
|
-
{
|
|
1524
|
-
{
|
|
1525
|
-
{
|
|
1526
|
-
{
|
|
1527
|
-
{
|
|
1528
|
-
{
|
|
1529
|
-
{
|
|
1530
|
-
{
|
|
1494
|
+
allowedChildrenCodes: [
|
|
1495
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1496
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN,
|
|
1497
|
+
{ code: "sidebar", required: false },
|
|
1498
|
+
{ code: "tag", required: false },
|
|
1499
|
+
{ code: "table1", required: false },
|
|
1500
|
+
{ code: "source1", required: false },
|
|
1501
|
+
{ code: "informalfigure", required: false },
|
|
1502
|
+
{ code: "figure1", required: false },
|
|
1503
|
+
{ code: "token", required: false },
|
|
1504
|
+
{ code: "referenceBibliomixed", required: false }
|
|
1531
1505
|
]
|
|
1532
1506
|
});
|
|
1533
1507
|
|
|
@@ -1538,7 +1512,7 @@ var TAG_SCHEMA = createSchema({
|
|
|
1538
1512
|
tag: TAG_TAG,
|
|
1539
1513
|
requiredAttributes: [...ID_ATTRS, "data-id"],
|
|
1540
1514
|
optionalAttributes: [],
|
|
1541
|
-
|
|
1515
|
+
allowedChildrenCodes: []
|
|
1542
1516
|
});
|
|
1543
1517
|
|
|
1544
1518
|
// src/schema/elementSchemas/elements/runningHeads/lrh.ts
|
|
@@ -1548,7 +1522,10 @@ var LRH_SCHEMA = createSchema({
|
|
|
1548
1522
|
tag: LRH_TAG,
|
|
1549
1523
|
requiredAttributes: [...ID_ATTRS],
|
|
1550
1524
|
optionalAttributes: [],
|
|
1551
|
-
|
|
1525
|
+
allowedChildrenCodes: [
|
|
1526
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1527
|
+
{ code: "phrase", required: false }
|
|
1528
|
+
]
|
|
1552
1529
|
});
|
|
1553
1530
|
|
|
1554
1531
|
// src/schema/elementSchemas/elements/runningHeads/rrh.ts
|
|
@@ -1558,7 +1535,11 @@ var RRH_SCHEMA = createSchema({
|
|
|
1558
1535
|
tag: RRH_TAG,
|
|
1559
1536
|
requiredAttributes: [...ID_ATTRS],
|
|
1560
1537
|
optionalAttributes: [],
|
|
1561
|
-
|
|
1538
|
+
defaultChildCode: "rrh",
|
|
1539
|
+
allowedChildrenCodes: [
|
|
1540
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1541
|
+
{ code: "phrase", required: false }
|
|
1542
|
+
]
|
|
1562
1543
|
});
|
|
1563
1544
|
|
|
1564
1545
|
// src/schema/elementSchemas/elements/source.ts
|
|
@@ -1575,7 +1556,10 @@ var SOURCE_SCHEMA = createSchema({
|
|
|
1575
1556
|
defaultValue: "add-element"
|
|
1576
1557
|
}
|
|
1577
1558
|
],
|
|
1578
|
-
|
|
1559
|
+
allowedChildrenCodes: [
|
|
1560
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1561
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1562
|
+
]
|
|
1579
1563
|
});
|
|
1580
1564
|
|
|
1581
1565
|
// src/schema/elementSchemas/elements/subtitle.ts
|
|
@@ -1591,7 +1575,10 @@ var SUBTITLE_SCHEMA = createSchema({
|
|
|
1591
1575
|
defaultValue: "add-element"
|
|
1592
1576
|
}
|
|
1593
1577
|
],
|
|
1594
|
-
|
|
1578
|
+
allowedChildrenCodes: [
|
|
1579
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1580
|
+
{ code: "phrase", required: false }
|
|
1581
|
+
]
|
|
1595
1582
|
});
|
|
1596
1583
|
|
|
1597
1584
|
// src/schema/elementSchemas/elements/table/tp.ts
|
|
@@ -1601,9 +1588,9 @@ var TP_SCHEMA = createSchema({
|
|
|
1601
1588
|
tag: TP_TAG,
|
|
1602
1589
|
requiredAttributes: [],
|
|
1603
1590
|
optionalAttributes: [...ID_ATTRS],
|
|
1604
|
-
|
|
1605
|
-
...
|
|
1606
|
-
...
|
|
1591
|
+
allowedChildrenCodes: [
|
|
1592
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1593
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1607
1594
|
]
|
|
1608
1595
|
});
|
|
1609
1596
|
|
|
@@ -1618,10 +1605,10 @@ var TD_SCHEMA = createSchema({
|
|
|
1618
1605
|
LAYOUT_CELL_WIDTH_ATTRIBUTE,
|
|
1619
1606
|
"width"
|
|
1620
1607
|
],
|
|
1621
|
-
|
|
1622
|
-
{
|
|
1623
|
-
{
|
|
1624
|
-
{
|
|
1608
|
+
allowedChildrenCodes: [
|
|
1609
|
+
{ code: "tp", required: false },
|
|
1610
|
+
{ code: "ul", required: false },
|
|
1611
|
+
{ code: "ol", required: false }
|
|
1625
1612
|
]
|
|
1626
1613
|
});
|
|
1627
1614
|
|
|
@@ -1632,7 +1619,7 @@ var TR_SCHEMA = createSchema({
|
|
|
1632
1619
|
tag: TR_TAG,
|
|
1633
1620
|
requiredAttributes: [],
|
|
1634
1621
|
optionalAttributes: [...LAYOUT_ATTRIBUTES, ...ID_ATTRS, "width"],
|
|
1635
|
-
|
|
1622
|
+
allowedChildrenCodes: [{ code: "td", required: true }]
|
|
1636
1623
|
});
|
|
1637
1624
|
|
|
1638
1625
|
// src/schema/elementSchemas/elements/table/thead.ts
|
|
@@ -1642,7 +1629,7 @@ var THEAD_SCHEMA = createSchema({
|
|
|
1642
1629
|
tag: THEAD_TAG,
|
|
1643
1630
|
requiredAttributes: [],
|
|
1644
1631
|
optionalAttributes: [...ID_ATTRS],
|
|
1645
|
-
|
|
1632
|
+
allowedChildrenCodes: [{ code: "tr", required: true }]
|
|
1646
1633
|
});
|
|
1647
1634
|
|
|
1648
1635
|
// src/schema/elementSchemas/elements/table/tbody.ts
|
|
@@ -1652,7 +1639,7 @@ var TBODY_SCHEMA = createSchema({
|
|
|
1652
1639
|
tag: TBODY_TAG,
|
|
1653
1640
|
requiredAttributes: [],
|
|
1654
1641
|
optionalAttributes: [...ID_ATTRS],
|
|
1655
|
-
|
|
1642
|
+
allowedChildrenCodes: [{ code: "tr", required: true }]
|
|
1656
1643
|
});
|
|
1657
1644
|
|
|
1658
1645
|
// src/schema/elementSchemas/elements/table/htmlTable.ts
|
|
@@ -1662,9 +1649,10 @@ var HTML_TABLE_SCHEMA = createSchema({
|
|
|
1662
1649
|
tag: HTML_TABLE_TAG,
|
|
1663
1650
|
requiredAttributes: [],
|
|
1664
1651
|
optionalAttributes: [...ID_ATTRS],
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
{
|
|
1652
|
+
defaultChildCode: "table",
|
|
1653
|
+
allowedChildrenCodes: [
|
|
1654
|
+
{ code: "thead", required: false },
|
|
1655
|
+
{ code: "tbody", required: true }
|
|
1668
1656
|
]
|
|
1669
1657
|
});
|
|
1670
1658
|
|
|
@@ -1675,7 +1663,7 @@ var TGROUP_SCHEMA = createSchema({
|
|
|
1675
1663
|
tag: TGROUP_TAG,
|
|
1676
1664
|
requiredAttributes: [...ID_ATTRS, "cols"],
|
|
1677
1665
|
optionalAttributes: [],
|
|
1678
|
-
|
|
1666
|
+
allowedChildrenCodes: [{ code: "table", required: true }]
|
|
1679
1667
|
});
|
|
1680
1668
|
|
|
1681
1669
|
// src/schema/elementSchemas/elements/table/tblfn.ts
|
|
@@ -1685,9 +1673,9 @@ var TBLFN_SCHEMA = createSchema({
|
|
|
1685
1673
|
tag: TBLFN_TAG,
|
|
1686
1674
|
requiredAttributes: [...ID_ATTRS],
|
|
1687
1675
|
optionalAttributes: [],
|
|
1688
|
-
|
|
1689
|
-
...
|
|
1690
|
-
...
|
|
1676
|
+
allowedChildrenCodes: [
|
|
1677
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1678
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
1691
1679
|
]
|
|
1692
1680
|
});
|
|
1693
1681
|
|
|
@@ -1698,7 +1686,7 @@ var TBLSOURCE_SCHEMA = createSchema({
|
|
|
1698
1686
|
tag: TBLSOURCE_TAG,
|
|
1699
1687
|
requiredAttributes: [],
|
|
1700
1688
|
optionalAttributes: [],
|
|
1701
|
-
|
|
1689
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
1702
1690
|
});
|
|
1703
1691
|
|
|
1704
1692
|
// src/schema/elementSchemas/elements/table/table1.ts
|
|
@@ -1725,12 +1713,12 @@ var TABLE_SCHEMA = createSchema({
|
|
|
1725
1713
|
"orient",
|
|
1726
1714
|
"xmlid"
|
|
1727
1715
|
],
|
|
1728
|
-
|
|
1729
|
-
{
|
|
1730
|
-
{
|
|
1731
|
-
{
|
|
1732
|
-
{
|
|
1733
|
-
{
|
|
1716
|
+
allowedChildrenCodes: [
|
|
1717
|
+
{ code: "label1", required: false },
|
|
1718
|
+
{ code: "tgroup", required: true },
|
|
1719
|
+
{ code: "title1", required: false },
|
|
1720
|
+
{ code: "tblfn", required: false },
|
|
1721
|
+
{ code: "tblsource", required: false }
|
|
1734
1722
|
]
|
|
1735
1723
|
});
|
|
1736
1724
|
|
|
@@ -1755,7 +1743,10 @@ var TITLE_SCHEMA = createSchema({
|
|
|
1755
1743
|
defaultValue: "H1"
|
|
1756
1744
|
}
|
|
1757
1745
|
],
|
|
1758
|
-
|
|
1746
|
+
allowedChildrenCodes: [
|
|
1747
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
1748
|
+
{ code: "phrase", required: false }
|
|
1749
|
+
]
|
|
1759
1750
|
});
|
|
1760
1751
|
|
|
1761
1752
|
// src/schema/elementSchemas/elements/abstract.ts
|
|
@@ -1779,12 +1770,12 @@ var ABSTRACT_SCHEMA = createSchema({
|
|
|
1779
1770
|
defaultValue: "blurb"
|
|
1780
1771
|
}
|
|
1781
1772
|
],
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
{
|
|
1785
|
-
{
|
|
1786
|
-
{
|
|
1787
|
-
{
|
|
1773
|
+
defaultChildCode: "para",
|
|
1774
|
+
allowedChildrenCodes: [
|
|
1775
|
+
{ code: "para", required: false },
|
|
1776
|
+
{ code: "title1", required: false },
|
|
1777
|
+
{ code: "ul", required: false },
|
|
1778
|
+
{ code: "ol", required: false }
|
|
1788
1779
|
]
|
|
1789
1780
|
});
|
|
1790
1781
|
|
|
@@ -1795,11 +1786,11 @@ var APPENDIX_SCHEMA = createSchema({
|
|
|
1795
1786
|
tag: APPENDIX_TAG,
|
|
1796
1787
|
requiredAttributes: [...ID_ATTRS, "id", "xmlid"],
|
|
1797
1788
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
{
|
|
1801
|
-
{
|
|
1802
|
-
{
|
|
1789
|
+
defaultChildCode: "para",
|
|
1790
|
+
allowedChildrenCodes: [
|
|
1791
|
+
{ code: "para", required: false },
|
|
1792
|
+
{ code: "title1", required: false },
|
|
1793
|
+
{ code: "label1", required: false }
|
|
1803
1794
|
]
|
|
1804
1795
|
});
|
|
1805
1796
|
|
|
@@ -1820,13 +1811,13 @@ var BLOCKQUOTE_SCHEMA = createSchema({
|
|
|
1820
1811
|
defaultValue: "add-element"
|
|
1821
1812
|
}
|
|
1822
1813
|
],
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
{
|
|
1826
|
-
{
|
|
1827
|
-
{
|
|
1828
|
-
{
|
|
1829
|
-
{
|
|
1814
|
+
defaultChildCode: "para",
|
|
1815
|
+
allowedChildrenCodes: [
|
|
1816
|
+
{ code: "para", required: false },
|
|
1817
|
+
{ code: "ul", required: false },
|
|
1818
|
+
{ code: "ol", required: false },
|
|
1819
|
+
{ code: "sidebar", required: false },
|
|
1820
|
+
{ code: "source1", required: false }
|
|
1830
1821
|
]
|
|
1831
1822
|
});
|
|
1832
1823
|
|
|
@@ -1852,10 +1843,10 @@ var BOX_SCHEMA = createSchema({
|
|
|
1852
1843
|
defaultValue: "add-element"
|
|
1853
1844
|
}
|
|
1854
1845
|
],
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
{
|
|
1858
|
-
{
|
|
1846
|
+
defaultChildCode: "para",
|
|
1847
|
+
allowedChildrenCodes: [
|
|
1848
|
+
{ code: "para", required: false },
|
|
1849
|
+
{ code: "title1", required: false }
|
|
1859
1850
|
]
|
|
1860
1851
|
});
|
|
1861
1852
|
|
|
@@ -1872,26 +1863,27 @@ var CHAPTER_SCHEMA = createSchema({
|
|
|
1872
1863
|
"data-paragraph-numbering-elements",
|
|
1873
1864
|
"data-paragraph-numbering-chapters"
|
|
1874
1865
|
],
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
{
|
|
1878
|
-
{
|
|
1879
|
-
{
|
|
1880
|
-
{
|
|
1881
|
-
{
|
|
1882
|
-
{
|
|
1883
|
-
{
|
|
1884
|
-
{
|
|
1885
|
-
{
|
|
1886
|
-
{
|
|
1887
|
-
{
|
|
1888
|
-
{
|
|
1889
|
-
{
|
|
1890
|
-
{
|
|
1891
|
-
{
|
|
1892
|
-
{
|
|
1893
|
-
{
|
|
1894
|
-
{
|
|
1866
|
+
defaultChildCode: "para",
|
|
1867
|
+
allowedChildrenCodes: [
|
|
1868
|
+
{ code: "lrh", required: false },
|
|
1869
|
+
{ code: "rrh", required: false },
|
|
1870
|
+
{ code: "info1", required: false },
|
|
1871
|
+
{ code: "heading", required: false },
|
|
1872
|
+
{ code: "footnoteSection", required: false },
|
|
1873
|
+
{ code: "para", required: false },
|
|
1874
|
+
{ code: "title1", required: false },
|
|
1875
|
+
{ code: "sidebar", required: false },
|
|
1876
|
+
{ code: "epigraph", required: false },
|
|
1877
|
+
{ code: "blockquote", required: false },
|
|
1878
|
+
{ code: "ul", required: false },
|
|
1879
|
+
{ code: "ol", required: false },
|
|
1880
|
+
{ code: "subtitle1", required: false },
|
|
1881
|
+
{ code: "poem", required: false },
|
|
1882
|
+
{ code: "dialogue", required: false },
|
|
1883
|
+
{ code: "appendix", required: false },
|
|
1884
|
+
{ code: "table1", required: false },
|
|
1885
|
+
{ code: "figure1", required: false },
|
|
1886
|
+
{ code: "referenceBibliography", required: false }
|
|
1895
1887
|
]
|
|
1896
1888
|
});
|
|
1897
1889
|
|
|
@@ -1910,8 +1902,8 @@ var EPIGRAPH_SCHEMA = createSchema({
|
|
|
1910
1902
|
defaultValue: "add-element"
|
|
1911
1903
|
}
|
|
1912
1904
|
],
|
|
1913
|
-
|
|
1914
|
-
|
|
1905
|
+
defaultChildCode: "para",
|
|
1906
|
+
allowedChildrenCodes: [{ code: "para", required: false }]
|
|
1915
1907
|
});
|
|
1916
1908
|
|
|
1917
1909
|
// src/schema/elementSchemas/elements/footnoteSection.ts
|
|
@@ -1928,10 +1920,10 @@ var FOOTNOTE_SECTION_SCHEMA = createSchema({
|
|
|
1928
1920
|
}
|
|
1929
1921
|
],
|
|
1930
1922
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
{
|
|
1934
|
-
{
|
|
1923
|
+
defaultChildCode: "para",
|
|
1924
|
+
allowedChildrenCodes: [
|
|
1925
|
+
{ code: "footnote", required: true },
|
|
1926
|
+
{ code: "title1", required: true }
|
|
1935
1927
|
]
|
|
1936
1928
|
});
|
|
1937
1929
|
|
|
@@ -1950,25 +1942,26 @@ var HEADING_SCHEMA = createSchema({
|
|
|
1950
1942
|
}
|
|
1951
1943
|
],
|
|
1952
1944
|
optionalAttributes: [...TRACK_CHANGES_ATTRS],
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
{
|
|
1956
|
-
{
|
|
1957
|
-
{
|
|
1958
|
-
{
|
|
1959
|
-
{
|
|
1960
|
-
{
|
|
1961
|
-
{
|
|
1962
|
-
{
|
|
1963
|
-
{
|
|
1964
|
-
{
|
|
1965
|
-
{
|
|
1966
|
-
{
|
|
1967
|
-
{
|
|
1968
|
-
{
|
|
1969
|
-
{
|
|
1970
|
-
{
|
|
1971
|
-
{
|
|
1945
|
+
defaultChildCode: "para",
|
|
1946
|
+
allowedChildrenCodes: [
|
|
1947
|
+
{ code: "title1", required: false },
|
|
1948
|
+
{ code: "label1", required: false },
|
|
1949
|
+
{ code: "para", required: false },
|
|
1950
|
+
{ code: "subtitle1", required: false },
|
|
1951
|
+
{ code: "sidebar", required: false },
|
|
1952
|
+
{ code: "epigraph", required: false },
|
|
1953
|
+
{ code: "blockquote", required: false },
|
|
1954
|
+
{ code: "ul", required: false },
|
|
1955
|
+
{ code: "ol", required: false },
|
|
1956
|
+
{ code: "poem", required: false },
|
|
1957
|
+
{ code: "dialogue", required: false },
|
|
1958
|
+
{ code: "appendix", required: false },
|
|
1959
|
+
{ code: "table1", required: false },
|
|
1960
|
+
{ code: "figure1", required: false },
|
|
1961
|
+
{ code: "heading", required: false },
|
|
1962
|
+
{ code: "footnoteSection", required: false },
|
|
1963
|
+
{ code: "info1", required: false },
|
|
1964
|
+
{ code: "equation", required: false }
|
|
1972
1965
|
]
|
|
1973
1966
|
});
|
|
1974
1967
|
|
|
@@ -1979,14 +1972,14 @@ var INFO_SCHEMA = createSchema({
|
|
|
1979
1972
|
tag: INFO_TAG,
|
|
1980
1973
|
requiredAttributes: [...ID_ATTRS],
|
|
1981
1974
|
optionalAttributes: [],
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
{
|
|
1985
|
-
{
|
|
1986
|
-
{
|
|
1987
|
-
{
|
|
1988
|
-
{
|
|
1989
|
-
{
|
|
1975
|
+
defaultChildCode: "subtitle1",
|
|
1976
|
+
allowedChildrenCodes: [
|
|
1977
|
+
{ code: "label1", required: true },
|
|
1978
|
+
{ code: "title1", required: true },
|
|
1979
|
+
{ code: "subtitle1", required: false },
|
|
1980
|
+
{ code: "abstract1", required: false },
|
|
1981
|
+
{ code: "keywordset", required: false },
|
|
1982
|
+
{ code: "authorgroup", required: false }
|
|
1990
1983
|
]
|
|
1991
1984
|
});
|
|
1992
1985
|
|
|
@@ -1997,10 +1990,10 @@ var POEM_SCHEMA = createSchema({
|
|
|
1997
1990
|
tag: POEM_TAG,
|
|
1998
1991
|
requiredAttributes: [...ID_ATTRS],
|
|
1999
1992
|
optionalAttributes: [...TRACK_CHANGES_ATTRS, "role"],
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
{
|
|
2003
|
-
{
|
|
1993
|
+
defaultChildCode: "line",
|
|
1994
|
+
allowedChildrenCodes: [
|
|
1995
|
+
{ code: "line", required: true },
|
|
1996
|
+
{ code: "source1", required: false }
|
|
2004
1997
|
]
|
|
2005
1998
|
});
|
|
2006
1999
|
|
|
@@ -2011,10 +2004,14 @@ var MATHPHRASE_SCHEMA = createSchema({
|
|
|
2011
2004
|
tag: MATHPHRASE_TAG,
|
|
2012
2005
|
requiredAttributes: [ELE_ID_ATTRIBUTE],
|
|
2013
2006
|
optionalAttributes: [],
|
|
2014
|
-
|
|
2015
|
-
{
|
|
2007
|
+
allowedChildrenCodes: [
|
|
2008
|
+
{ code: MATH_SCHEMA.code, required: true },
|
|
2009
|
+
{
|
|
2010
|
+
code: INSERTION_SCHEMA.code,
|
|
2011
|
+
required: false
|
|
2012
|
+
},
|
|
2016
2013
|
{
|
|
2017
|
-
|
|
2014
|
+
code: DELETION_SCHEMA.code,
|
|
2018
2015
|
required: false
|
|
2019
2016
|
}
|
|
2020
2017
|
]
|
|
@@ -2034,11 +2031,11 @@ var BIBLIODIV_SCHEMA = createSchema({
|
|
|
2034
2031
|
}
|
|
2035
2032
|
],
|
|
2036
2033
|
optionalAttributes: [],
|
|
2037
|
-
|
|
2038
|
-
{
|
|
2039
|
-
{
|
|
2040
|
-
{
|
|
2041
|
-
{
|
|
2034
|
+
allowedChildrenCodes: [
|
|
2035
|
+
{ code: "bibliodiv", required: false },
|
|
2036
|
+
{ code: "referenceBibliomixed", required: false },
|
|
2037
|
+
{ code: "para", required: false },
|
|
2038
|
+
{ code: "title1", required: false }
|
|
2042
2039
|
]
|
|
2043
2040
|
});
|
|
2044
2041
|
|
|
@@ -2062,11 +2059,11 @@ var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
|
|
|
2062
2059
|
}
|
|
2063
2060
|
],
|
|
2064
2061
|
optionalAttributes: [],
|
|
2065
|
-
|
|
2066
|
-
{
|
|
2067
|
-
{
|
|
2068
|
-
{
|
|
2069
|
-
{
|
|
2062
|
+
allowedChildrenCodes: [
|
|
2063
|
+
{ code: "bibliodiv", required: false },
|
|
2064
|
+
{ code: "referenceBibliomixed", required: false },
|
|
2065
|
+
{ code: "para", required: false },
|
|
2066
|
+
{ code: "title1", required: false }
|
|
2070
2067
|
]
|
|
2071
2068
|
});
|
|
2072
2069
|
|
|
@@ -2081,7 +2078,7 @@ var BIBLIOMIXED_SCHEMA = createSchema({
|
|
|
2081
2078
|
TRACK_CHANGES_ATTR_DATA_USERID,
|
|
2082
2079
|
TRACK_CHANGES_ATTR_DATA_DATE
|
|
2083
2080
|
],
|
|
2084
|
-
|
|
2081
|
+
allowedChildrenCodes: []
|
|
2085
2082
|
});
|
|
2086
2083
|
|
|
2087
2084
|
// src/schema/elementSchemas/elements/index.ts
|
|
@@ -2180,6 +2177,13 @@ var ELEMENT_SCHEMAS = {
|
|
|
2180
2177
|
affiliation: AFFILIATION_SCHEMA
|
|
2181
2178
|
};
|
|
2182
2179
|
|
|
2180
|
+
// src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
|
|
2181
|
+
var FOOTNOTE_LINK_TAG = "FOOTNOTE1";
|
|
2182
|
+
var INLINEEQUATION_TAG = "INLINEEQUATION";
|
|
2183
|
+
var LINK_TAG = "LINK1";
|
|
2184
|
+
var URI_TAG = "URI";
|
|
2185
|
+
var PHRASE_TAG = "PHRASE";
|
|
2186
|
+
|
|
2183
2187
|
// src/schema/elementSchemas/inlineElements/footnoteLink.ts
|
|
2184
2188
|
var FOOTNOTE_LINK_SCHEMA = createSchema({
|
|
2185
2189
|
code: "footnote1",
|
|
@@ -2187,8 +2191,8 @@ var FOOTNOTE_LINK_SCHEMA = createSchema({
|
|
|
2187
2191
|
tag: FOOTNOTE_LINK_TAG,
|
|
2188
2192
|
requiredAttributes: [...ID_ATTRS],
|
|
2189
2193
|
optionalAttributes: ["linkend"],
|
|
2190
|
-
|
|
2191
|
-
|
|
2194
|
+
defaultChildCode: "sup",
|
|
2195
|
+
allowedChildrenCodes: [{ code: "sup", required: true }]
|
|
2192
2196
|
});
|
|
2193
2197
|
|
|
2194
2198
|
// src/schema/elementSchemas/inlineElements/inlineequation.ts
|
|
@@ -2210,12 +2214,7 @@ var INLINEEQUATION_SCHEMA = createSchema({
|
|
|
2210
2214
|
defaultValue: "added"
|
|
2211
2215
|
}
|
|
2212
2216
|
],
|
|
2213
|
-
|
|
2214
|
-
forbiddenElements: [
|
|
2215
|
-
{ code: QUERY_SCHEMA.code, resolveTo: "skip" },
|
|
2216
|
-
{ code: COMMENT_SCHEMA.code, resolveTo: "skip" },
|
|
2217
|
-
{ code: COMMENT_QUERY_SECTION_SCHEMA.code, resolveTo: "skip" }
|
|
2218
|
-
]
|
|
2217
|
+
allowedChildrenCodes: [{ code: "mathphrase", required: true }]
|
|
2219
2218
|
});
|
|
2220
2219
|
|
|
2221
2220
|
// src/schema/elementSchemas/inlineElements/link.ts
|
|
@@ -2234,7 +2233,7 @@ var LINK_SCHEMA = createSchema({
|
|
|
2234
2233
|
}
|
|
2235
2234
|
],
|
|
2236
2235
|
optionalAttributes: [],
|
|
2237
|
-
|
|
2236
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
2238
2237
|
});
|
|
2239
2238
|
|
|
2240
2239
|
// src/schema/elementSchemas/inlineElements/uri.ts
|
|
@@ -2244,7 +2243,17 @@ var URI_SCHEMA = createSchema({
|
|
|
2244
2243
|
tag: URI_TAG,
|
|
2245
2244
|
requiredAttributes: [...ID_ATTRS],
|
|
2246
2245
|
optionalAttributes: ["linkend"],
|
|
2247
|
-
|
|
2246
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
2247
|
+
});
|
|
2248
|
+
|
|
2249
|
+
// src/schema/elementSchemas/inlineElements/phrase.ts
|
|
2250
|
+
var PHRASE_SCHEMA = createSchema({
|
|
2251
|
+
code: "phrase",
|
|
2252
|
+
kind: "inline",
|
|
2253
|
+
tag: PHRASE_TAG,
|
|
2254
|
+
requiredAttributes: [...ID_ATTRS, "xml:lang"],
|
|
2255
|
+
optionalAttributes: [],
|
|
2256
|
+
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
2248
2257
|
});
|
|
2249
2258
|
|
|
2250
2259
|
// src/schema/elementSchemas/inlineElements/index.ts
|
|
@@ -2252,7 +2261,8 @@ var INLINE_ELEMENT_SCHEMAS = {
|
|
|
2252
2261
|
uri: URI_SCHEMA,
|
|
2253
2262
|
footnote1: FOOTNOTE_LINK_SCHEMA,
|
|
2254
2263
|
link: LINK_SCHEMA,
|
|
2255
|
-
inlineequation: INLINEEQUATION_SCHEMA
|
|
2264
|
+
inlineequation: INLINEEQUATION_SCHEMA,
|
|
2265
|
+
phrase: PHRASE_SCHEMA
|
|
2256
2266
|
};
|
|
2257
2267
|
|
|
2258
2268
|
// src/schema/schemas.ts
|
|
@@ -2383,7 +2393,8 @@ var ElementLabel = {
|
|
|
2383
2393
|
footnote1: "Footnote",
|
|
2384
2394
|
inlineequation: "Inline Equation",
|
|
2385
2395
|
link: "Link",
|
|
2386
|
-
uri: "URI"
|
|
2396
|
+
uri: "URI",
|
|
2397
|
+
phrase: "Phrase"
|
|
2387
2398
|
};
|
|
2388
2399
|
|
|
2389
2400
|
// src/schema/shared/ignoredElements.ts
|
|
@@ -2394,6 +2405,9 @@ var IGNORED_ELEMENT_SELECTORS = [
|
|
|
2394
2405
|
"span.missLink",
|
|
2395
2406
|
"span.ref-drag"
|
|
2396
2407
|
];
|
|
2408
|
+
var IGNORED_VALIDATION_ELEMENT_SELECTORS = [
|
|
2409
|
+
"referenceBibliomixed"
|
|
2410
|
+
];
|
|
2397
2411
|
|
|
2398
2412
|
// src/schema/shared/ignoredAttributes.ts
|
|
2399
2413
|
var IGNORED_ATTRIBUTES = [
|
|
@@ -2410,7 +2424,8 @@ var IGNORED_ATTRIBUTES = [
|
|
|
2410
2424
|
"translate",
|
|
2411
2425
|
"lang",
|
|
2412
2426
|
"dir",
|
|
2413
|
-
"hidden"
|
|
2427
|
+
"hidden",
|
|
2428
|
+
"data-gramm"
|
|
2414
2429
|
];
|
|
2415
2430
|
var IGNORED_ATTRIBUTES_STARTS_WITH = ["er-", "er_", "drop", "drag"];
|
|
2416
2431
|
|
|
@@ -2419,13 +2434,8 @@ var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute) |
|
|
|
2419
2434
|
(startsWith) => attribute.startsWith(startsWith)
|
|
2420
2435
|
);
|
|
2421
2436
|
var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
|
|
2437
|
+
var isIgnoredValidation = (code) => IGNORED_VALIDATION_ELEMENT_SELECTORS.includes(code);
|
|
2422
2438
|
var findSchemaByCode = (code) => SCHEMAS[code];
|
|
2423
|
-
var findSchemaByTagName = (tagName) => {
|
|
2424
|
-
const candidates = Object.values(SCHEMAS).filter(
|
|
2425
|
-
(schema) => schema.tag === tagName.toUpperCase()
|
|
2426
|
-
);
|
|
2427
|
-
return candidates;
|
|
2428
|
-
};
|
|
2429
2439
|
var findSchemaByElement = (element) => {
|
|
2430
2440
|
const tagName = element.tagName.toUpperCase();
|
|
2431
2441
|
const isInsertion = element.classList.contains("ins");
|
|
@@ -2457,8 +2467,6 @@ var findSchemaByElement = (element) => {
|
|
|
2457
2467
|
return findSchemaByCode("footnoteSection");
|
|
2458
2468
|
}
|
|
2459
2469
|
}
|
|
2460
|
-
const candidates = findSchemaByTagName(element.tagName.toUpperCase());
|
|
2461
|
-
return candidates[0];
|
|
2462
2470
|
};
|
|
2463
2471
|
var isAttributeRestricted = (attr) => typeof attr !== "string";
|
|
2464
2472
|
var getAttributeName = (attribute) => typeof attribute === "string" ? attribute.toLowerCase() : attribute.name.toLowerCase();
|
|
@@ -2696,7 +2704,7 @@ var validateAttributes = (element, schema) => {
|
|
|
2696
2704
|
};
|
|
2697
2705
|
|
|
2698
2706
|
// src/validation/validateChildren.ts
|
|
2699
|
-
var validateElementAgainstSchema = (element, schema
|
|
2707
|
+
var validateElementAgainstSchema = (element, schema) => {
|
|
2700
2708
|
const errors = [];
|
|
2701
2709
|
if (element.tagName.toUpperCase() !== schema.tag) {
|
|
2702
2710
|
addValidationIssue(errors, {
|
|
@@ -2708,20 +2716,19 @@ var validateElementAgainstSchema = (element, schema, inheritedForbiddenScope) =>
|
|
|
2708
2716
|
});
|
|
2709
2717
|
}
|
|
2710
2718
|
errors.push(...validateAttributes(element, schema));
|
|
2711
|
-
errors.push(...validateChildren(element, schema
|
|
2719
|
+
errors.push(...validateChildren(element, schema));
|
|
2712
2720
|
return errors;
|
|
2713
2721
|
};
|
|
2714
|
-
var validateChildren = (element, schema
|
|
2722
|
+
var validateChildren = (element, schema) => {
|
|
2715
2723
|
const errors = [];
|
|
2716
2724
|
const childElements = [...element.children].filter(
|
|
2717
2725
|
(child) => !isIgnoredElement(child)
|
|
2718
2726
|
);
|
|
2719
|
-
const allowedChildren = [...schema.
|
|
2727
|
+
const allowedChildren = [...schema.allowedChildrenCodes];
|
|
2720
2728
|
if (schema.kind === "atom") {
|
|
2721
2729
|
return errors;
|
|
2722
2730
|
}
|
|
2723
2731
|
for (const child of childElements) {
|
|
2724
|
-
const childTag = child.tagName.toUpperCase();
|
|
2725
2732
|
const childSchema = findSchemaByElement(child);
|
|
2726
2733
|
if (!childSchema) {
|
|
2727
2734
|
addValidationIssue(errors, {
|
|
@@ -2733,25 +2740,8 @@ var validateChildren = (element, schema, inheritedForbiddenScope) => {
|
|
|
2733
2740
|
});
|
|
2734
2741
|
continue;
|
|
2735
2742
|
}
|
|
2736
|
-
const forbiddenScope = [
|
|
2737
|
-
...inheritedForbiddenScope || [],
|
|
2738
|
-
...childSchema.forbiddenElements || []
|
|
2739
|
-
];
|
|
2740
|
-
const forbiddenChild = forbiddenScope.find(
|
|
2741
|
-
(element2) => element2.code === childSchema.code
|
|
2742
|
-
);
|
|
2743
|
-
if (forbiddenChild) {
|
|
2744
|
-
addValidationIssue(errors, {
|
|
2745
|
-
store: getStore(child),
|
|
2746
|
-
title: `Forbidden element ${child.tagName}`,
|
|
2747
|
-
level: "blocker",
|
|
2748
|
-
kind: "forbidden",
|
|
2749
|
-
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.`
|
|
2750
|
-
});
|
|
2751
|
-
continue;
|
|
2752
|
-
}
|
|
2753
2743
|
const allowedChild = allowedChildren.find(
|
|
2754
|
-
(candidate) => candidate.
|
|
2744
|
+
(candidate) => candidate.code === childSchema.code
|
|
2755
2745
|
);
|
|
2756
2746
|
if (!allowedChild) {
|
|
2757
2747
|
addValidationIssue(errors, {
|
|
@@ -2763,32 +2753,28 @@ var validateChildren = (element, schema, inheritedForbiddenScope) => {
|
|
|
2763
2753
|
});
|
|
2764
2754
|
continue;
|
|
2765
2755
|
}
|
|
2766
|
-
errors.push(
|
|
2767
|
-
...validateElementAgainstSchema(
|
|
2768
|
-
child,
|
|
2769
|
-
childSchema,
|
|
2770
|
-
new Set(forbiddenScope)
|
|
2771
|
-
)
|
|
2772
|
-
);
|
|
2756
|
+
errors.push(...validateElementAgainstSchema(child, childSchema));
|
|
2773
2757
|
}
|
|
2774
2758
|
for (const allowedChild of allowedChildren) {
|
|
2775
2759
|
if (!allowedChild.required) {
|
|
2776
2760
|
continue;
|
|
2777
2761
|
}
|
|
2778
|
-
const hasChild = childElements.some(
|
|
2779
|
-
|
|
2780
|
-
|
|
2762
|
+
const hasChild = childElements.some((child) => {
|
|
2763
|
+
const childSchema = findSchemaByElement(child);
|
|
2764
|
+
return childSchema?.code === allowedChild.code;
|
|
2765
|
+
});
|
|
2781
2766
|
if (!hasChild) {
|
|
2767
|
+
const requiredChildLabel = ElementLabel[allowedChild.code];
|
|
2782
2768
|
addValidationIssue(errors, {
|
|
2783
2769
|
store: getStore(element),
|
|
2784
|
-
title: `Missing required child element ${
|
|
2770
|
+
title: `Missing required child element ${requiredChildLabel}`,
|
|
2785
2771
|
level: "warning",
|
|
2786
2772
|
kind: "missing",
|
|
2787
|
-
description: `The child element ${
|
|
2773
|
+
description: `The child element ${requiredChildLabel} is required but not present.`
|
|
2788
2774
|
});
|
|
2789
2775
|
}
|
|
2790
2776
|
}
|
|
2791
|
-
if (schema.
|
|
2777
|
+
if (schema.allowedChildrenCodes.size === 0 && childElements.length > 0) {
|
|
2792
2778
|
addValidationIssue(errors, {
|
|
2793
2779
|
store: getStore(element),
|
|
2794
2780
|
title: "Atom element cannot contain child elements",
|
|
@@ -2847,13 +2833,7 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
|
|
|
2847
2833
|
const schema = findSchemaByElement(element);
|
|
2848
2834
|
if (schema) {
|
|
2849
2835
|
if (schemasToValidateAgainst.includes(schema.code)) {
|
|
2850
|
-
errors.push(
|
|
2851
|
-
...validateElementAgainstSchema(
|
|
2852
|
-
element,
|
|
2853
|
-
schema,
|
|
2854
|
-
schema.forbiddenElements
|
|
2855
|
-
)
|
|
2856
|
-
);
|
|
2836
|
+
errors.push(...validateElementAgainstSchema(element, schema));
|
|
2857
2837
|
}
|
|
2858
2838
|
const role = element.getAttribute("role") || "";
|
|
2859
2839
|
const linkableRoles = getLinkableRoles();
|
|
@@ -2862,11 +2842,13 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
|
|
|
2862
2842
|
}
|
|
2863
2843
|
if (schema.tag === BIBLIOMIXED_SCHEMA.tag) {
|
|
2864
2844
|
errors.push(...validateReferenceCited(element, linkElements));
|
|
2865
|
-
return errors;
|
|
2866
2845
|
}
|
|
2867
2846
|
if (schema.tag === FOOTNOTE_SCHEMA.tag) {
|
|
2868
2847
|
errors.push(...validateFootnoteCue(element, root));
|
|
2869
2848
|
}
|
|
2849
|
+
if (isIgnoredValidation(schema.code)) {
|
|
2850
|
+
return [];
|
|
2851
|
+
}
|
|
2870
2852
|
}
|
|
2871
2853
|
for (const child of Array.from(element.children)) {
|
|
2872
2854
|
errors.push(
|
|
@@ -2909,6 +2891,7 @@ export {
|
|
|
2909
2891
|
IGNORED_ATTRIBUTES,
|
|
2910
2892
|
IGNORED_ATTRIBUTES_STARTS_WITH,
|
|
2911
2893
|
IGNORED_ELEMENT_SELECTORS,
|
|
2894
|
+
IGNORED_VALIDATION_ELEMENT_SELECTORS,
|
|
2912
2895
|
INDENT_TYPE_ATTRIBUTE,
|
|
2913
2896
|
INLINE_ELEMENT_SCHEMAS,
|
|
2914
2897
|
LAYOUT_ATTRIBUTES,
|
|
@@ -2933,10 +2916,10 @@ export {
|
|
|
2933
2916
|
findAttributeDefinitionByName,
|
|
2934
2917
|
findSchemaByCode,
|
|
2935
2918
|
findSchemaByElement,
|
|
2936
|
-
findSchemaByTagName,
|
|
2937
2919
|
getAttributeName,
|
|
2938
2920
|
isAttributeRestricted,
|
|
2939
2921
|
isIgnoredAttribute,
|
|
2940
2922
|
isIgnoredElement,
|
|
2923
|
+
isIgnoredValidation,
|
|
2941
2924
|
validateXml
|
|
2942
2925
|
};
|