pro-editor-schema 0.1.190 → 0.1.191
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 +24 -16
- package/dist/index.mjs +24 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -404,8 +404,8 @@ var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
|
|
|
404
404
|
"secondEntry",
|
|
405
405
|
"thirdEntry",
|
|
406
406
|
"entry",
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
"linkend",
|
|
408
|
+
...ID_ATTRS
|
|
409
409
|
];
|
|
410
410
|
var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
|
|
411
411
|
name: "index-position",
|
|
@@ -421,7 +421,7 @@ var SEE_REQUIRED_ATTRIBUTES = [
|
|
|
421
421
|
values: ["see", "see-also"],
|
|
422
422
|
defaultValue: ""
|
|
423
423
|
},
|
|
424
|
-
|
|
424
|
+
...ID_ATTRS,
|
|
425
425
|
"data-date",
|
|
426
426
|
"crossref-firstEntry",
|
|
427
427
|
"crossref-secondEntry",
|
|
@@ -459,7 +459,7 @@ var INDEXTERM_SCHEMA = createSchema({
|
|
|
459
459
|
values: ["PRIMARY", "SECONDARY", "TERTIARY", "QUATERNARY"],
|
|
460
460
|
defaultValue: "PRIMARY"
|
|
461
461
|
},
|
|
462
|
-
|
|
462
|
+
...ID_ATTRS
|
|
463
463
|
],
|
|
464
464
|
optionalAttributes: [],
|
|
465
465
|
allowedChildTagNames: [
|
|
@@ -2386,20 +2386,28 @@ var findSchemaByElement = (element) => {
|
|
|
2386
2386
|
const isDeletion = element.classList.contains("del");
|
|
2387
2387
|
const isQueryComment = element.classList.contains("cmtQurySection");
|
|
2388
2388
|
const role = element.getAttribute("role");
|
|
2389
|
-
if (
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2389
|
+
if (tagName === SPAN_TAG) {
|
|
2390
|
+
if (isQueryComment) {
|
|
2391
|
+
return findSchemaByCode("commentQuerySection");
|
|
2392
|
+
}
|
|
2393
|
+
if (isInsertion) {
|
|
2394
|
+
return findSchemaByCode("insertion");
|
|
2395
|
+
}
|
|
2396
|
+
if (isDeletion) {
|
|
2397
|
+
return findSchemaByCode("deletion");
|
|
2398
|
+
}
|
|
2397
2399
|
}
|
|
2398
|
-
if (
|
|
2399
|
-
if (role
|
|
2400
|
-
|
|
2400
|
+
if (tagName === SECTION_TAG) {
|
|
2401
|
+
if (role) {
|
|
2402
|
+
if (role.startsWith("H")) {
|
|
2403
|
+
return findSchemaByCode("heading");
|
|
2404
|
+
}
|
|
2405
|
+
if (role === "ch" || role === "bk") {
|
|
2406
|
+
return findSchemaByCode("footnoteSection");
|
|
2407
|
+
}
|
|
2401
2408
|
}
|
|
2402
|
-
|
|
2409
|
+
const isFootnoteSectionWithoutRole = element.querySelector(FOOTNOTE_TAG);
|
|
2410
|
+
if (isFootnoteSectionWithoutRole) {
|
|
2403
2411
|
return findSchemaByCode("footnoteSection");
|
|
2404
2412
|
}
|
|
2405
2413
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -340,8 +340,8 @@ var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
|
|
|
340
340
|
"secondEntry",
|
|
341
341
|
"thirdEntry",
|
|
342
342
|
"entry",
|
|
343
|
-
|
|
344
|
-
|
|
343
|
+
"linkend",
|
|
344
|
+
...ID_ATTRS
|
|
345
345
|
];
|
|
346
346
|
var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
|
|
347
347
|
name: "index-position",
|
|
@@ -357,7 +357,7 @@ var SEE_REQUIRED_ATTRIBUTES = [
|
|
|
357
357
|
values: ["see", "see-also"],
|
|
358
358
|
defaultValue: ""
|
|
359
359
|
},
|
|
360
|
-
|
|
360
|
+
...ID_ATTRS,
|
|
361
361
|
"data-date",
|
|
362
362
|
"crossref-firstEntry",
|
|
363
363
|
"crossref-secondEntry",
|
|
@@ -395,7 +395,7 @@ var INDEXTERM_SCHEMA = createSchema({
|
|
|
395
395
|
values: ["PRIMARY", "SECONDARY", "TERTIARY", "QUATERNARY"],
|
|
396
396
|
defaultValue: "PRIMARY"
|
|
397
397
|
},
|
|
398
|
-
|
|
398
|
+
...ID_ATTRS
|
|
399
399
|
],
|
|
400
400
|
optionalAttributes: [],
|
|
401
401
|
allowedChildTagNames: [
|
|
@@ -2322,20 +2322,28 @@ var findSchemaByElement = (element) => {
|
|
|
2322
2322
|
const isDeletion = element.classList.contains("del");
|
|
2323
2323
|
const isQueryComment = element.classList.contains("cmtQurySection");
|
|
2324
2324
|
const role = element.getAttribute("role");
|
|
2325
|
-
if (
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2325
|
+
if (tagName === SPAN_TAG) {
|
|
2326
|
+
if (isQueryComment) {
|
|
2327
|
+
return findSchemaByCode("commentQuerySection");
|
|
2328
|
+
}
|
|
2329
|
+
if (isInsertion) {
|
|
2330
|
+
return findSchemaByCode("insertion");
|
|
2331
|
+
}
|
|
2332
|
+
if (isDeletion) {
|
|
2333
|
+
return findSchemaByCode("deletion");
|
|
2334
|
+
}
|
|
2333
2335
|
}
|
|
2334
|
-
if (
|
|
2335
|
-
if (role
|
|
2336
|
-
|
|
2336
|
+
if (tagName === SECTION_TAG) {
|
|
2337
|
+
if (role) {
|
|
2338
|
+
if (role.startsWith("H")) {
|
|
2339
|
+
return findSchemaByCode("heading");
|
|
2340
|
+
}
|
|
2341
|
+
if (role === "ch" || role === "bk") {
|
|
2342
|
+
return findSchemaByCode("footnoteSection");
|
|
2343
|
+
}
|
|
2337
2344
|
}
|
|
2338
|
-
|
|
2345
|
+
const isFootnoteSectionWithoutRole = element.querySelector(FOOTNOTE_TAG);
|
|
2346
|
+
if (isFootnoteSectionWithoutRole) {
|
|
2339
2347
|
return findSchemaByCode("footnoteSection");
|
|
2340
2348
|
}
|
|
2341
2349
|
}
|