pro-editor-schema 0.0.2 → 0.0.21
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 +12 -3
- package/dist/index.mjs +12 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -584,9 +584,18 @@ var findSchemaByElement = (element) => {
|
|
|
584
584
|
const isInsertion = element.classList.contains("ins");
|
|
585
585
|
const isDeletion = element.classList.contains("del");
|
|
586
586
|
const isQueryComment = element.classList.contains("cmtQurySection");
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
589
|
-
|
|
587
|
+
const role = element.getAttribute("role");
|
|
588
|
+
if (role) {
|
|
589
|
+
if (role.startsWith("H")) {
|
|
590
|
+
return SCHEMA_MAP.get(
|
|
591
|
+
element.tagName.toUpperCase() + "HEADING" /* HEADING */
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
if (role === "ch" || role === "bk") {
|
|
595
|
+
return SCHEMA_MAP.get(
|
|
596
|
+
element.tagName.toUpperCase() + "FOOTNOT" /* FOOTNOTE */
|
|
597
|
+
);
|
|
598
|
+
}
|
|
590
599
|
}
|
|
591
600
|
if (isInsertion) {
|
|
592
601
|
return SCHEMA_MAP.get(element.tagName.toUpperCase() + "INS" /* INS */);
|
package/dist/index.mjs
CHANGED
|
@@ -509,9 +509,18 @@ var findSchemaByElement = (element) => {
|
|
|
509
509
|
const isInsertion = element.classList.contains("ins");
|
|
510
510
|
const isDeletion = element.classList.contains("del");
|
|
511
511
|
const isQueryComment = element.classList.contains("cmtQurySection");
|
|
512
|
-
const
|
|
513
|
-
if (
|
|
514
|
-
|
|
512
|
+
const role = element.getAttribute("role");
|
|
513
|
+
if (role) {
|
|
514
|
+
if (role.startsWith("H")) {
|
|
515
|
+
return SCHEMA_MAP.get(
|
|
516
|
+
element.tagName.toUpperCase() + "HEADING" /* HEADING */
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
if (role === "ch" || role === "bk") {
|
|
520
|
+
return SCHEMA_MAP.get(
|
|
521
|
+
element.tagName.toUpperCase() + "FOOTNOT" /* FOOTNOTE */
|
|
522
|
+
);
|
|
523
|
+
}
|
|
515
524
|
}
|
|
516
525
|
if (isInsertion) {
|
|
517
526
|
return SCHEMA_MAP.get(element.tagName.toUpperCase() + "INS" /* INS */);
|