@paroicms/quill-editor-plugin 1.14.0 → 1.15.0

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.
@@ -19,6 +19,8 @@ async function convertQuillDeltaToHtml(service, delta, options) {
19
19
  return obfuscateBlotProcessing(value, customOp.attributes);
20
20
  if (type === "img")
21
21
  return imgBlotProcessing(service, value, options);
22
+ if (type === "video-plugin")
23
+ return videoPluginBlotProcessing(service, value, options);
22
24
  service.logger.warn(`Invalid blot '${type}'`);
23
25
  return "";
24
26
  });
@@ -32,6 +34,8 @@ function convertQuillDeltaToPlainText(service, delta) {
32
34
  return value.html;
33
35
  if (type === "img")
34
36
  return "";
37
+ if (type === "video-plugin")
38
+ return "";
35
39
  service.logger.warn(`Invalid blot '${type}'`);
36
40
  return "";
37
41
  });
@@ -132,3 +136,15 @@ function formatObfuscateAsALink(val) {
132
136
  return "tel";
133
137
  throw new Error(`invalid link-type '${val}'`);
134
138
  }
139
+ function videoPluginBlotProcessing(service, value, options) {
140
+ const videoId = (0, data_formatters_lib_1.strValOrUndef)(value);
141
+ if (!videoId)
142
+ return "";
143
+ return `
144
+ <iframe
145
+ width="420"
146
+ height="315"
147
+ src="https://www.youtube.com/embed/${encodeURIComponent(videoId)}"
148
+ ></iframe>
149
+ `;
150
+ }