@mdream/js 2.0.1 → 2.0.3
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.
|
@@ -58,12 +58,15 @@ function processPluginsForEvent(event, plugins, state, processEvent) {
|
|
|
58
58
|
const element = event.node;
|
|
59
59
|
for (let index = 0; index < plugins.length; index++) {
|
|
60
60
|
const plugin = plugins[index];
|
|
61
|
+
if (plugin === void 0) throw new TypeError("Plugin arrays must not contain undefined entries.");
|
|
61
62
|
if (plugin.processAttributes) plugin.processAttributes(element, state);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
let shouldSkip = false;
|
|
65
66
|
for (let index = 0; index < plugins.length; index++) {
|
|
66
|
-
const
|
|
67
|
+
const plugin = plugins[index];
|
|
68
|
+
if (plugin === void 0) throw new TypeError("Plugin arrays must not contain undefined entries.");
|
|
69
|
+
const res = plugin.beforeNodeProcess?.(event, state);
|
|
67
70
|
if (typeof res === "object") shouldSkip = res.skip;
|
|
68
71
|
}
|
|
69
72
|
if (shouldSkip) return true;
|
|
@@ -73,6 +76,7 @@ function processPluginsForEvent(event, plugins, state, processEvent) {
|
|
|
73
76
|
let pluginOutputs;
|
|
74
77
|
for (let index = 0; index < plugins.length; index++) {
|
|
75
78
|
const plugin = plugins[index];
|
|
79
|
+
if (plugin === void 0) throw new TypeError("Plugin arrays must not contain undefined entries.");
|
|
76
80
|
if (plugin[fn]) {
|
|
77
81
|
const result = plugin[fn](element, state);
|
|
78
82
|
if (result) (pluginOutputs ??= []).push(result);
|
|
@@ -83,6 +87,7 @@ function processPluginsForEvent(event, plugins, state, processEvent) {
|
|
|
83
87
|
const textNode = event.node;
|
|
84
88
|
for (let index = 0; index < plugins.length; index++) {
|
|
85
89
|
const plugin = plugins[index];
|
|
90
|
+
if (plugin === void 0) throw new TypeError("Plugin arrays must not contain undefined entries.");
|
|
86
91
|
if (plugin.processTextNode) {
|
|
87
92
|
const result = plugin.processTextNode(textNode, state);
|
|
88
93
|
if (result) {
|
|
@@ -98,7 +103,11 @@ function processPluginsForEvent(event, plugins, state, processEvent) {
|
|
|
98
103
|
}
|
|
99
104
|
function endPlugins(plugins, state) {
|
|
100
105
|
if (!plugins) return;
|
|
101
|
-
for (let index = 0; index < plugins.length; index++)
|
|
106
|
+
for (let index = 0; index < plugins.length; index++) {
|
|
107
|
+
const plugin = plugins[index];
|
|
108
|
+
if (plugin === void 0) throw new TypeError("Plugin arrays must not contain undefined entries.");
|
|
109
|
+
plugin.onDocumentEnd?.(state);
|
|
110
|
+
}
|
|
102
111
|
}
|
|
103
112
|
function buildTagOverrideHandlers(overrides, tagHandlers) {
|
|
104
113
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -478,10 +478,10 @@ function processTailwindClasses(classAttr) {
|
|
|
478
478
|
weight = supersede(weight, breakpoint, true);
|
|
479
479
|
break;
|
|
480
480
|
case "line-through":
|
|
481
|
-
case "underline":
|
|
482
481
|
decoration = supersede(decoration, breakpoint, true);
|
|
483
482
|
break;
|
|
484
483
|
case "no-underline":
|
|
484
|
+
case "underline":
|
|
485
485
|
decoration = supersede(decoration, breakpoint, false);
|
|
486
486
|
break;
|
|
487
487
|
case "hidden":
|