Repository navigation
Expand file tree
/
Copy pathedjsHTML.browser.js
More file actions
1 lines (1 loc) · 2.56 KB
/
Copy pathedjsHTML.browser.js
File metadata and controls
1 lines (1 loc) · 2.56 KB
1
var edjsHTML=function(){"use strict";var t=function(){return t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var e={code:function(t){var e=t.data;return"<pre><code>".concat(e.code,"</code></pre>")},embed:function(t){var e=t.data,r=e.service;return"vimeo"===r?'<iframe src="'.concat(e.embed,'" height="').concat(e.height,'" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>'):"youtube"===r?'<iframe width="'.concat(e.width,'" height="').concat(e.height,'" src="').concat(e.embed,'" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'):(console.error("[editorjs-html]: Only Youtube & Vimeo embeds are available by default. Write your own embed parser for other options."),"")},header:function(t){var e=t.data;return"<h".concat(e.level,">").concat(e.text,"</h").concat(e.level,">")},image:function(t){var e,r=t.data,n=r.caption?r.caption:"Image",o=(null===(e=null==r?void 0:r.file)||void 0===e?void 0:e.url)||(null==r?void 0:r.url);return'<img src="'.concat(o,'" alt="').concat(n,'" />')},list:function(t){var e=t.data,r="unordered"===e.style?"ul":"ol",n=function(t,e){var r=t.map((function(t){var r;if(!t.content&&!t.items)return"<li>".concat(t,"</li>");var o="";return(null===(r=t.items)||void 0===r?void 0:r.length)&&(o=n(t.items,e)),t.content?"<li>".concat(t.content).concat(o,"</li>"):void 0}));return"<".concat(e,">").concat(r.join(""),"</").concat(e,">")};return n(e.items,r)},paragraph:function(t){var e=t.data,r=e.alignment||e.align;return r?'<p style="text-align:'.concat(r,'"> ').concat(e.text," </p>"):"<p>".concat(e.text,"</p>")},quote:function(t){var e=t.data;return"<blockquote>".concat(e.text,"</blockquote> - ").concat(e.caption)},delimiter:function(t){return t.data,"<br/>"}};return function(r,n){void 0===r&&(r={}),void 0===n&&(n={strict:!1});var o=t(t({},e),r);return{parse:function(t){return function(t,e,r){return t.blocks.reduce((function(t,n){if(n.type in e)return t+e[n.type](n);var o="[editorjs-html]: Parser function for ".concat(n.type," does not exist");if(r.strict)throw new Error(o);return console.error(o),t}),"")}(t,o,n)},parseBlock:function(t){return function(t,e,r){if(t.type in e)return e[t.type](t);var n="[editorjs-html]: Parser function for ".concat(t.type," does not exist");if(r.strict)throw new Error(n);console.error(n)}(t,o,n)}}}}();