@ckeditor/ckeditor5-markdown-gfm 41.3.1 → 41.4.0-alpha.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.
- package/build/markdown-gfm.js +1 -1
- package/dist/index-content.css +4 -0
- package/dist/index-editor.css +4 -0
- package/dist/index.css +4 -0
- package/dist/index.js +355 -0
- package/dist/index.js.map +1 -0
- package/dist/types/augmentation.d.ts +15 -0
- package/dist/types/gfmdataprocessor.d.ts +66 -0
- package/dist/types/html2markdown/html2markdown.d.ts +14 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/markdown.d.ts +27 -0
- package/dist/types/markdown2html/markdown2html.d.ts +17 -0
- package/dist/types/pastefrommarkdownexperimental.d.ts +78 -0
- package/package.json +3 -2
- package/src/html2markdown/html2markdown.js +1 -1
package/build/markdown-gfm.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md.
|
4
|
-
*/(()=>{var e={331:(e,t,n)=>{e.exports=n(237)("./src/clipboard.js")},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},237:e=>{"use strict";e.exports=CKEditor5.dll},662:()=>{}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Markdown:()=>Ee,PasteFromMarkdownExperimental:()=>Oe});var e=n(782),t=n(783);function i(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let s={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const l=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,h={"&":"&","<":"<",">":">",'"':""","'":"'"},u=e=>h[e];function p(e,t){if(t){if(l.test(e))return e.replace(o,u)}else if(a.test(e))return e.replace(c,u);return e}const f=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(f,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const g=/(^|[^\[])\^/g;function m(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(g,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const k=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(e,t,n){if(e){let e;try{e=decodeURIComponent(d(n)).replace(k,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!x.test(n)&&(n=function(e,t){w[" "+e]||(y.test(e)?w[" "+e]=e+"/":w[" "+e]=T(e,"/",!0));e=w[" "+e];const n=-1===e.indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(_,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(v,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const w={},y=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;const S={exec:function(){}};function z(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function $(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function T(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const s=e.charAt(r-i-1);if(s!==t||n){if(s===t||!n)break;i++}else i++}return e.substr(0,r-i)}function A(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function R(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function N(e,t,n,r){const i=t.href,s=t.title?p(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:i,title:s,text:l,tokens:r.inlineTokens(l,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:s,text:p(l)}}class C{constructor(e){this.options=e||s}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:T(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=T(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,i,s,l,o,a,c,h,u,p,f,d=t[1].trim();const g=d.length>1,m={type:"list",raw:"",ordered:g,start:g?+d.slice(0,-1):"",loose:!1,items:[]};d=g?`\\d{1,9}\\${d.slice(-1)}`:`\\${d}`,this.options.pedantic&&(d=g?d:"[*+-]");const k=new RegExp(`^( {0,3}${d})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=k.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0],h=e.split("\n",1)[0],this.options.pedantic?(s=2,p=c.trimLeft()):(s=t[2].search(/[^ ]/),s=s>4?1:s,p=c.slice(s),s+=t[1].length),o=!1,!c&&/^ *$/.test(h)&&(n+=h+"\n",e=e.substring(h.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(u=e.split("\n",1)[0],c=u,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(c));){if(c.search(/[^ ]/)>=s||!c.trim())p+="\n"+c.slice(s);else{if(o)break;p+="\n"+c}o||c.trim()||(o=!0),n+=u+"\n",e=e.substring(u.length+1)}}m.loose||(a?m.loose=!0:/\n *\n *$/.test(n)&&(a=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(i="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:n,task:!!r,checked:i,loose:!1,text:p}),m.raw+=n}m.items[m.items.length-1].raw=n.trimRight(),m.items[m.items.length-1].text=p.trimRight(),m.raw=m.raw.trimRight();const x=m.items.length;for(l=0;l<x;l++){this.lexer.state.top=!1,m.items[l].tokens=this.lexer.blockTokens(m.items[l].text,[]);const e=m.items[l].tokens.filter((e=>"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let n=0;for(const e of t)if("\n"===e&&(n+=1),n>1)return!0;return!1}));!m.loose&&e.length&&t&&(m.loose=!0,m.items[l].loose=!0)}return m}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):p(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:$(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,i,s,l=e.align.length;for(n=0;n<l;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(l=e.rows.length,n=0;n<l;n++)e.rows[n]=$(e.rows[n],e.header.length).map((e=>({text:e})));for(l=e.header.length,r=0;r<l;r++)e.header[r].tokens=[],this.lexer.inlineTokens(e.header[r].text,e.header[r].tokens);for(l=e.rows.length,r=0;r<l;r++)for(s=e.rows[r],i=0;i<s.length;i++)s[i].tokens=[],this.lexer.inlineTokens(s[i].text,s[i].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:p(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):p(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=T(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),N(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return N(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=r[1]||r[2]||"";if(!i||i&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let i,s,l=n,o=0;const a="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=a.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(s=i.length,r[3]||r[4]){l+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){o+=s;continue}if(l-=s,l>0)continue;if(s=Math.min(s,s+l+o),Math.min(n,s)%2){const t=e.slice(1,n+r.index+s);return{type:"em",raw:e.slice(0,n+r.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+s-1);return{type:"strong",raw:e.slice(0,n+r.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=p(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=p(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=p(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=p(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=p(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):p(n[0]):n[0]:p(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const E={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};E.def=m(E.def).replace("label",E._label).replace("title",E._title).getRegex(),E.bullet=/(?:[*+-]|\d{1,9}[.)])/,E.listItemStart=m(/^( *)(bull) */).replace("bull",E.bullet).getRegex(),E.list=m(E.list).replace(/bull/g,E.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+E.def.source+")").getRegex(),E._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",E._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,E.html=m(E.html,"i").replace("comment",E._comment).replace("tag",E._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),E.paragraph=m(E._paragraph).replace("hr",E.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E._tag).getRegex(),E.blockquote=m(E.blockquote).replace("paragraph",E.paragraph).getRegex(),E.normal=z({},E),E.gfm=z({},E.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),E.gfm.table=m(E.gfm.table).replace("hr",E.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E._tag).getRegex(),E.gfm.paragraph=m(E._paragraph).replace("hr",E.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",E.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E._tag).getRegex(),E.pedantic=z({},E.normal,{html:m("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",E._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:S,paragraph:m(E.normal._paragraph).replace("hr",E.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",E.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const I={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:S,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:S,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function D(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function O(e){let t,n,r="";const i=e.length;for(t=0;t<i;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}I._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",I.punctuation=m(I.punctuation).replace(/punctuation/g,I._punctuation).getRegex(),I.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,I.escapedEmSt=/\\\*|\\_/g,I._comment=m(E._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),I.emStrong.lDelim=m(I.emStrong.lDelim).replace(/punct/g,I._punctuation).getRegex(),I.emStrong.rDelimAst=m(I.emStrong.rDelimAst,"g").replace(/punct/g,I._punctuation).getRegex(),I.emStrong.rDelimUnd=m(I.emStrong.rDelimUnd,"g").replace(/punct/g,I._punctuation).getRegex(),I._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,I._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,I._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,I.autolink=m(I.autolink).replace("scheme",I._scheme).replace("email",I._email).getRegex(),I._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,I.tag=m(I.tag).replace("comment",I._comment).replace("attribute",I._attribute).getRegex(),I._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,I._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,I._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,I.link=m(I.link).replace("label",I._label).replace("href",I._href).replace("title",I._title).getRegex(),I.reflink=m(I.reflink).replace("label",I._label).replace("ref",E._label).getRegex(),I.nolink=m(I.nolink).replace("ref",E._label).getRegex(),I.reflinkSearch=m(I.reflinkSearch,"g").replace("reflink",I.reflink).replace("nolink",I.nolink).getRegex(),I.normal=z({},I),I.pedantic=z({},I.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:m(/^!?\[(label)\]\((.*?)\)/).replace("label",I._label).getRegex(),reflink:m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",I._label).getRegex()}),I.gfm=z({},I.normal,{escape:m(I.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),I.gfm.url=m(I.gfm.url,"i").replace("email",I.gfm._extended_email).getRegex(),I.breaks=z({},I.gfm,{br:m(I.br).replace("{2,}","*").getRegex(),text:m(I.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class L{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||s,this.options.tokenizer=this.options.tokenizer||new C,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:E.normal,inline:I.normal};this.options.pedantic?(t.block=E.pedantic,t.inline=I.pedantic):this.options.gfm&&(t.block=E.gfm,this.options.breaks?t.inline=I.breaks:t.inline=I.gfm),this.tokenizer.rules=t}static get rules(){return{block:E,inline:I}}static lex(e,t){return new L(t).lex(e)}static lexInline(e,t){return new L(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,i,s;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,i,s,l,o,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+R("a",s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,s.index)+"["+R("a",s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(a));)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(o=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,O))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,O))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i,D))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),l=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class P{constructor(e){this.options=e||s}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+p(r,!0)+'">'+(n?e:p(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:p(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=b(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+p(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=b(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class B{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class q{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class M{constructor(e){this.options=e||s,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new B,this.slugger=new q}static parse(e,t){return new M(t).parse(e)}static parseInline(e,t){return new M(t).parseInline(e)}parse(e,t=!0){let n,r,i,s,l,o,a,c,h,u,p,f,g,m,k,x,b,w,y,_="";const v=e.length;for(n=0;n<v;n++)if(u=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[u.type]&&(y=this.options.extensions.renderers[u.type].call({parser:this},u),!1!==y||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)))_+=y||"";else switch(u.type){case"space":continue;case"hr":_+=this.renderer.hr();continue;case"heading":_+=this.renderer.heading(this.parseInline(u.tokens),u.depth,d(this.parseInline(u.tokens,this.textRenderer)),this.slugger);continue;case"code":_+=this.renderer.code(u.text,u.lang,u.escaped);continue;case"table":for(c="",a="",s=u.header.length,r=0;r<s;r++)a+=this.renderer.tablecell(this.parseInline(u.header[r].tokens),{header:!0,align:u.align[r]});for(c+=this.renderer.tablerow(a),h="",s=u.rows.length,r=0;r<s;r++){for(o=u.rows[r],a="",l=o.length,i=0;i<l;i++)a+=this.renderer.tablecell(this.parseInline(o[i].tokens),{header:!1,align:u.align[i]});h+=this.renderer.tablerow(a)}_+=this.renderer.table(c,h);continue;case"blockquote":h=this.parse(u.tokens),_+=this.renderer.blockquote(h);continue;case"list":for(p=u.ordered,f=u.start,g=u.loose,s=u.items.length,h="",r=0;r<s;r++)k=u.items[r],x=k.checked,b=k.task,m="",k.task&&(w=this.renderer.checkbox(x),g?k.tokens.length>0&&"paragraph"===k.tokens[0].type?(k.tokens[0].text=w+" "+k.tokens[0].text,k.tokens[0].tokens&&k.tokens[0].tokens.length>0&&"text"===k.tokens[0].tokens[0].type&&(k.tokens[0].tokens[0].text=w+" "+k.tokens[0].tokens[0].text)):k.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(k.tokens,g),h+=this.renderer.listitem(m,b,x);_+=this.renderer.list(h,p,f);continue;case"html":_+=this.renderer.html(u.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(h=u.tokens?this.parseInline(u.tokens):u.text;n+1<v&&"text"===e[n+1].type;)u=e[++n],h+="\n"+(u.tokens?this.parseInline(u.tokens):u.text);_+=t?this.renderer.paragraph(h):h;continue;default:{const e='Token with "'+u.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return _}parseInline(e,t){t=t||this.renderer;let n,r,i,s="";const l=e.length;for(n=0;n<l;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(i=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==i||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))s+=i||"";else switch(r.type){case"escape":case"text":s+=t.text(r.text);break;case"html":s+=t.html(r.text);break;case"link":s+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":s+=t.image(r.href,r.title,r.text);break;case"strong":s+=t.strong(this.parseInline(r.tokens,t));break;case"em":s+=t.em(this.parseInline(r.tokens,t));break;case"codespan":s+=t.codespan(r.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return s}}function Z(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),A(t=z({},Z.defaults,t||{})),n){const r=t.highlight;let i;try{i=L.lex(e,t)}catch(e){return n(e)}const s=function(e){let s;if(!e)try{t.walkTokens&&Z.walkTokens(i,t.walkTokens),s=M.parse(i,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,s)};if(!r||r.length<3)return s();if(delete t.highlight,!i.length)return s();let l=0;return Z.walkTokens(i,(function(e){"code"===e.type&&(l++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return s(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),l--,0===l&&s()}))}),0))})),void(0===l&&s())}try{const n=L.lex(e,t);return t.walkTokens&&Z.walkTokens(n,t.walkTokens),M.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+p(e.message+"",!0)+"</pre>";throw e}}Z.options=Z.setOptions=function(e){var t;return z(Z.defaults,e),t=Z.defaults,s=t,Z},Z.getDefaults=i,Z.defaults=s,Z.use=function(...e){const t=z({},...e),n=Z.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach((e=>{if(e.extensions&&(r=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=Z.defaults.renderer||new P;for(const t in e.renderer){const r=n[t];n[t]=(...i)=>{let s=e.renderer[t].apply(n,i);return!1===s&&(s=r.apply(n,i)),s}}t.renderer=n}if(e.tokenizer){const n=Z.defaults.tokenizer||new C;for(const t in e.tokenizer){const r=n[t];n[t]=(...i)=>{let s=e.tokenizer[t].apply(n,i);return!1===s&&(s=r.apply(n,i)),s}}t.tokenizer=n}if(e.walkTokens){const n=Z.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),Z.setOptions(t)}))},Z.walkTokens=function(e,t){for(const n of e)switch(t.call(Z,n),n.type){case"table":for(const e of n.header)Z.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)Z.walkTokens(n.tokens,t);break;case"list":Z.walkTokens(n.items,t);break;default:Z.defaults.extensions&&Z.defaults.extensions.childTokens&&Z.defaults.extensions.childTokens[n.type]?Z.defaults.extensions.childTokens[n.type].forEach((function(e){Z.walkTokens(n[e],t)})):n.tokens&&Z.walkTokens(n.tokens,t)}},Z.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");A(t=z({},Z.defaults,t||{}));try{const n=L.lexInline(e,t);return t.walkTokens&&Z.walkTokens(n,t.walkTokens),M.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+p(e.message+"",!0)+"</pre>";throw e}},Z.Parser=M,Z.parser=M.parse,Z.Renderer=P,Z.TextRenderer=B,Z.Lexer=L,Z.lexer=L.lex,Z.Tokenizer=C,Z.Slugger=q,Z.parse=Z;Z.options,Z.setOptions,Z.use,Z.walkTokens,Z.parseInline,M.parse,L.lex;function j(e,t){return Array(t+1).join(e)}Z.use({tokenizer:{autolink:()=>null,url:()=>null},renderer:{checkbox(...e){return Object.getPrototypeOf(this).checkbox.call(this,...e).trimRight()},code(...e){return Object.getPrototypeOf(this).code.call(this,...e).replace("\n</code>","</code>")}}});var F=["address","article","aside","audio","blockquote","body","canvas","center","dd","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","isindex","li","main","menu","nav","noframes","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul"];function H(e){return-1!==F.indexOf(e.nodeName.toLowerCase())}var U=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Q(e){return-1!==U.indexOf(e.nodeName.toLowerCase())}var V=U.join();var W={};function K(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function G(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(X(i,t,n))return i}}function X(e,t,n){var r=e.filter;if("string"==typeof r){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof r)throw new TypeError("`filter` needs to be a string, array, or function");if(r.call(e,t,n))return!0}}function J(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Y(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}W.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},W.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},W.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var r=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&r<3?"\n\n"+e+"\n"+j(1===r?"=":"-",e.length)+"\n\n":"\n\n"+j("#",r)+" "+e+"\n\n"}},W.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},W.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},W.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var r=n.bulletListMarker+" ",i=t.parentNode;if("OL"===i.nodeName){var s=i.getAttribute("start"),l=Array.prototype.indexOf.call(i.children,t);r=(s?Number(s)+l:l+1)+". "}return r+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},W.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},W.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){for(var r,i=((t.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1],s=t.firstChild.textContent,l=n.fence.charAt(0),o=3,a=new RegExp("^"+l+"{3,}","gm");r=a.exec(s);)r[0].length>=o&&(o=r[0].length+1);var c=j(l,o);return"\n\n"+c+i+"\n"+s.replace(/\n$/,"")+"\n"+c+"\n\n"}},W.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},W.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){return"["+e+"]("+t.getAttribute("href")+(t.title?' "'+t.title+'"':"")+")"}},W.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var r,i,s=t.getAttribute("href"),l=t.title?' "'+t.title+'"':"";switch(n.linkReferenceStyle){case"collapsed":r="["+e+"][]",i="["+e+"]: "+s+l;break;case"shortcut":r="["+e+"]",i="["+e+"]: "+s+l;break;default:var o=this.references.length+1;r="["+e+"]["+o+"]",i="["+o+"]: "+s+l}return this.references.push(i),r},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},W.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},W.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},W.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e.trim())return"";var t="`",n="",r="",i=e.match(/`+/gm);if(i)for(/^`/.test(e)&&(n=" "),/`$/.test(e)&&(r=" ");-1!==i.indexOf(t);)t+="`";return t+n+e+r+t}},W.image={filter:"img",replacement:function(e,t){var n=t.alt||"",r=t.getAttribute("src")||"",i=t.title||"";return r?"+")":""}},K.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=G(this.array,e,this.options))||(t=G(this._keep,e,this.options))||(t=G(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var ee="undefined"!=typeof window?window:{};var te,ne=function(){var e=ee.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?ee.DOMParser:function(){var e=function(){},t=n(662).JSDOM;return e.prototype.parseFromString=function(e){return new t(e).window.document},e}();function re(e){var t;"string"==typeof e?t=(te=te||new ne).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):t=e.cloneNode(!0);return function(e){var t=e.element,n=e.isBlock,r=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!i(t)){for(var s=null,l=!1,o=null,a=Y(o,t,i);a!==t;){if(3===a.nodeType||4===a.nodeType){var c=a.data.replace(/[ \r\n\t]+/g," ");if(s&&!/ $/.test(s.data)||l||" "!==c[0]||(c=c.substr(1)),!c){a=J(a);continue}a.data=c,s=a}else{if(1!==a.nodeType){a=J(a);continue}n(a)||"BR"===a.nodeName?(s&&(s.data=s.data.replace(/ $/,"")),s=null,l=!1):r(a)&&(s=null,l=!0)}var h=Y(o,a,i);o=a,a=h}s&&(s.data=s.data.replace(/ $/,""),s.data||J(s))}}({element:t,isBlock:H,isVoid:Q}),t}function ie(e){return e.isBlock=H(e),e.isCode="code"===e.nodeName.toLowerCase()||e.parentNode.isCode,e.isBlank=function(e){return-1===["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(e.nodeName)&&/^\s*$/i.test(e.textContent)&&!Q(e)&&!function(e){return e.querySelector&&e.querySelector(V)}(e)}(e),e.flankingWhitespace=function(e){var t="",n="";if(!e.isBlock){var r=/^\s/.test(e.textContent),i=/\s$/.test(e.textContent),s=e.isBlank&&r&&i;r&&!se("left",e)&&(t=" "),s||!i||se("right",e)||(n=" ")}return{leading:t,trailing:n}}(e),e}function se(e,t){var n,r,i;return"left"===e?(n=t.previousSibling,r=/ $/):(n=t.nextSibling,r=/^ /),n&&(3===n.nodeType?i=r.test(n.nodeValue):1!==n.nodeType||H(n)||(i=r.test(n.textContent))),i}var le=Array.prototype.reduce,oe=/^\n*/,ae=/\n*$/,ce=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function he(e){if(!(this instanceof he))return new he(e);var t={rules:W,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},t,e),this.rules=new K(this.options)}function ue(e){var t=this;return le.call(e.childNodes,(function(e,n){var r="";return 3===(n=new ie(n)).nodeType?r=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(r=fe.call(t,n)),de(e,r)}),"")}function pe(e){var t=this;return this.rules.forEach((function(n){"function"==typeof n.append&&(e=de(e,n.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function fe(e){var t=this.rules.forNode(e),n=ue.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function de(e,t){var n,r,i,s=(n=t,r=[e.match(ae)[0],n.match(oe)[0]].sort(),(i=r[r.length-1]).length<2?i:"\n\n");return(e=e.replace(ae,""))+s+(t=t.replace(oe,""))}he.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=ue.call(this,new re(e));return pe.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return ce.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};const ge=he;var me=/highlight-(?:text|source)-([a-z0-9]+)/;function ke(e){e.addRule("highlightedCodeBlock",{filter:function(e){var t=e.firstChild;return"DIV"===e.nodeName&&me.test(e.className)&&t&&"PRE"===t.nodeName},replacement:function(e,t,n){var r=((t.className||"").match(me)||[null,""])[1];return"\n\n"+n.fence+r+"\n"+t.firstChild.textContent+"\n"+n.fence+"\n\n"}})}function xe(e){e.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~"+e+"~"}})}var be=Array.prototype.indexOf,we=Array.prototype.every,ye={};function _e(e){var t,n,r=e.parentNode;return"THEAD"===r.nodeName||r.firstChild===e&&("TABLE"===r.nodeName||(n=(t=r).previousSibling,"TBODY"===t.nodeName&&(!n||"THEAD"===n.nodeName&&/^\s*$/i.test(n.textContent))))&&we.call(e.childNodes,(function(e){return"TH"===e.nodeName}))}function ve(e,t){var n=" ";return 0===be.call(t.parentNode.childNodes,t)&&(n="| "),n+e+" |"}function Se(e){for(var t in e.keep((function(e){return"TABLE"===e.nodeName&&!_e(e.rows[0])})),ye)e.addRule(t,ye[t])}function ze(e){e.addRule("taskListItems",{filter:function(e){return"checkbox"===e.type&&"LI"===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?"[x]":"[ ]")+" "}})}ye.tableCell={filter:["th","td"],replacement:function(e,t){return ve(e,t)}},ye.tableRow={filter:"tr",replacement:function(e,t){var n="",r={left:":--",right:"--:",center:":-:"};if(_e(t))for(var i=0;i<t.childNodes.length;i++){var s="---",l=(t.childNodes[i].getAttribute("align")||"").toLowerCase();l&&(s=r[l]||s),n+=ve(s,t.childNodes[i])}return"\n"+e+(n?"\n"+n:"")}},ye.table={filter:function(e){return"TABLE"===e.nodeName&&_e(e.rows[0])},replacement:function(e){return"\n\n"+(e=e.replace("\n\n","\n"))+"\n\n"}},ye.tableSection={filter:["thead","tbody","tfoot"],replacement:function(e){return e}};const $e=ge.prototype.escape;function Te(e){return e=(e=$e(e)).replace(/</g,"\\<")}ge.prototype.escape=function(e){let t="",n=0;for(const r of function*(e){for(const t of e.matchAll(Re)){const e=t[0],n=Ne(e);yield Object.assign([e.substring(0,n)],{index:t.index})}}(e)){const i=r.index;i>n&&(t+=Te(e.substring(n,i)));const s=r[0];t+=s,n=i+s.length}return n<e.length&&(t+=Te(e.substring(n,e.length))),t};const Ae=new ge({codeBlockStyle:"fenced",hr:"---",headingStyle:"atx"});Ae.use([function(e){e.use([ke,xe,Se,ze])},function(e){e.addRule("taskListItems",{filter:e=>"checkbox"===e.type&&("LI"===e.parentNode.nodeName||"LI"===e.parentNode.parentNode.nodeName),replacement:(e,t)=>(t.checked?"[x]":"[ ]")+" "})}]);const Re=new RegExp(/\b(?:(?:https?|ftp):\/\/|www\.)/.source+/(?![-_])(?:[-_a-z0-9\u00a1-\uffff]{1,63}\.)+(?:[a-z\u00a1-\uffff]{2,63})/.source+/(?:[^\s<>]*)/.source,"gi");function Ne(e){let t=e.length;for(;t>0;){const n=e[t-1];if("?!.,:*_~'\"".includes(n))t--;else{if(")"!=n)break;{let n=0;for(let r=0;r<t;r++)"("==e[r]?n++:")"==e[r]&&n--;if(!(n<0))break;t--}}}return t}class Ce{constructor(e){this._htmlDP=new t.HtmlDataProcessor(e)}keepHtml(e){Ae.keep([e])}toView(e){const t=(n=e,Z.parse(n,{gfm:!0,breaks:!0,tables:!0,xhtml:!0,headerIds:!1}));var n;return this._htmlDP.toView(t)}toData(e){return function(e){return Ae.turndown(e)}(this._htmlDP.toData(e))}registerRawContentMatcher(e){this._htmlDP.registerRawContentMatcher(e)}useFillerType(){}}class Ee extends e.Plugin{constructor(e){super(e),e.data.processor=new Ce(e.data.viewDocument)}static get pluginName(){return"Markdown"}}var Ie=n(331);const De=["SPAN","BR","PRE","CODE"];class Oe extends e.Plugin{constructor(e){super(e),this._gfmDataProcessor=new Ce(e.data.viewDocument)}static get pluginName(){return"PasteFromMarkdownExperimental"}static get requires(){return[Ie.ClipboardPipeline]}init(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ClipboardPipeline");let r=!1;this.listenTo(t,"keydown",((e,t)=>{r=t.shiftKey})),this.listenTo(n,"inputTransformation",((e,t)=>{if(r)return;const n=t.dataTransfer.getData("text/html");if(!n){const e=t.dataTransfer.getData("text/plain");return void(t.content=this._gfmDataProcessor.toView(e))}const i=this._parseMarkdownFromHtml(n);i&&(t.content=this._gfmDataProcessor.toView(i))}))}_parseMarkdownFromHtml(e){const t=this._removeOsSpecificTags(e);if(!this._containsOnlyAllowedFirstLevelTags(t))return null;const n=this._removeFirstLevelWrapperTagsAndBrs(t);return this._containsAnyRemainingHtmlTags(n)?null:this._replaceHtmlReservedEntitiesWithCharacters(n)}_removeOsSpecificTags(e){return e.replace(/^<meta\b[^>]*>/,"").trim().replace(/^<html>/,"").replace(/<\/html>$/,"").trim().replace(/^<body>/,"").replace(/<\/body>$/,"").trim().replace(/^<!--StartFragment-->/,"").replace(/<!--EndFragment-->$/,"").trim()}_containsOnlyAllowedFirstLevelTags(e){const t=new DOMParser,{body:n}=t.parseFromString(e,"text/html");return Array.from(n.children).map((e=>e.tagName)).every((e=>De.includes(e)))}_removeFirstLevelWrapperTagsAndBrs(e){const t=new DOMParser,{body:n}=t.parseFromString(e,"text/html"),r=n.querySelectorAll("br");for(const e of r)e.replaceWith("\n");const i=n.querySelectorAll(":scope > *");for(const e of i){const t=e.cloneNode(!0);e.replaceWith(...t.childNodes)}return n.innerHTML}_containsAnyRemainingHtmlTags(e){return e.includes("<")}_replaceHtmlReservedEntitiesWithCharacters(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/ /g," ")}}})(),(window.CKEditor5=window.CKEditor5||{}).markdownGfm=r})();
|
4
|
+
*/(()=>{var e={331:(e,t,n)=>{e.exports=n(237)("./src/clipboard.js")},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Markdown:()=>Ee,PasteFromMarkdownExperimental:()=>Oe});var e=n(782),t=n(783);function i(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let s={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const l=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,h={"&":"&","<":"<",">":">",'"':""","'":"'"},u=e=>h[e];function p(e,t){if(t){if(l.test(e))return e.replace(o,u)}else if(a.test(e))return e.replace(c,u);return e}const f=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(f,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const g=/(^|[^\[])\^/g;function m(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(g,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const k=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(e,t,n){if(e){let e;try{e=decodeURIComponent(d(n)).replace(k,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!x.test(n)&&(n=function(e,t){w[" "+e]||(y.test(e)?w[" "+e]=e+"/":w[" "+e]=T(e,"/",!0));e=w[" "+e];const n=-1===e.indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(_,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(v,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const w={},y=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;const S={exec:function(){}};function z(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function $(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function T(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const s=e.charAt(r-i-1);if(s!==t||n){if(s===t||!n)break;i++}else i++}return e.substr(0,r-i)}function A(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function R(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function N(e,t,n,r){const i=t.href,s=t.title?p(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:i,title:s,text:l,tokens:r.inlineTokens(l,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:s,text:p(l)}}class C{constructor(e){this.options=e||s}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:T(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=T(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,i,s,l,o,a,c,h,u,p,f,d=t[1].trim();const g=d.length>1,m={type:"list",raw:"",ordered:g,start:g?+d.slice(0,-1):"",loose:!1,items:[]};d=g?`\\d{1,9}\\${d.slice(-1)}`:`\\${d}`,this.options.pedantic&&(d=g?d:"[*+-]");const k=new RegExp(`^( {0,3}${d})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=k.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0],h=e.split("\n",1)[0],this.options.pedantic?(s=2,p=c.trimLeft()):(s=t[2].search(/[^ ]/),s=s>4?1:s,p=c.slice(s),s+=t[1].length),o=!1,!c&&/^ *$/.test(h)&&(n+=h+"\n",e=e.substring(h.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(u=e.split("\n",1)[0],c=u,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(c));){if(c.search(/[^ ]/)>=s||!c.trim())p+="\n"+c.slice(s);else{if(o)break;p+="\n"+c}o||c.trim()||(o=!0),n+=u+"\n",e=e.substring(u.length+1)}}m.loose||(a?m.loose=!0:/\n *\n *$/.test(n)&&(a=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(i="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:n,task:!!r,checked:i,loose:!1,text:p}),m.raw+=n}m.items[m.items.length-1].raw=n.trimRight(),m.items[m.items.length-1].text=p.trimRight(),m.raw=m.raw.trimRight();const x=m.items.length;for(l=0;l<x;l++){this.lexer.state.top=!1,m.items[l].tokens=this.lexer.blockTokens(m.items[l].text,[]);const e=m.items[l].tokens.filter((e=>"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let n=0;for(const e of t)if("\n"===e&&(n+=1),n>1)return!0;return!1}));!m.loose&&e.length&&t&&(m.loose=!0,m.items[l].loose=!0)}return m}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):p(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:$(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,i,s,l=e.align.length;for(n=0;n<l;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(l=e.rows.length,n=0;n<l;n++)e.rows[n]=$(e.rows[n],e.header.length).map((e=>({text:e})));for(l=e.header.length,r=0;r<l;r++)e.header[r].tokens=[],this.lexer.inlineTokens(e.header[r].text,e.header[r].tokens);for(l=e.rows.length,r=0;r<l;r++)for(s=e.rows[r],i=0;i<s.length;i++)s[i].tokens=[],this.lexer.inlineTokens(s[i].text,s[i].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:p(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):p(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=T(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),N(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return N(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=r[1]||r[2]||"";if(!i||i&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let i,s,l=n,o=0;const a="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=a.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(s=i.length,r[3]||r[4]){l+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){o+=s;continue}if(l-=s,l>0)continue;if(s=Math.min(s,s+l+o),Math.min(n,s)%2){const t=e.slice(1,n+r.index+s);return{type:"em",raw:e.slice(0,n+r.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+s-1);return{type:"strong",raw:e.slice(0,n+r.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=p(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=p(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=p(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=p(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=p(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):p(n[0]):n[0]:p(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const E={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};E.def=m(E.def).replace("label",E._label).replace("title",E._title).getRegex(),E.bullet=/(?:[*+-]|\d{1,9}[.)])/,E.listItemStart=m(/^( *)(bull) */).replace("bull",E.bullet).getRegex(),E.list=m(E.list).replace(/bull/g,E.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+E.def.source+")").getRegex(),E._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",E._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,E.html=m(E.html,"i").replace("comment",E._comment).replace("tag",E._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),E.paragraph=m(E._paragraph).replace("hr",E.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E._tag).getRegex(),E.blockquote=m(E.blockquote).replace("paragraph",E.paragraph).getRegex(),E.normal=z({},E),E.gfm=z({},E.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),E.gfm.table=m(E.gfm.table).replace("hr",E.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E._tag).getRegex(),E.gfm.paragraph=m(E._paragraph).replace("hr",E.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",E.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E._tag).getRegex(),E.pedantic=z({},E.normal,{html:m("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",E._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:S,paragraph:m(E.normal._paragraph).replace("hr",E.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",E.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const I={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:S,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:S,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function D(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function O(e){let t,n,r="";const i=e.length;for(t=0;t<i;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}I._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",I.punctuation=m(I.punctuation).replace(/punctuation/g,I._punctuation).getRegex(),I.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,I.escapedEmSt=/\\\*|\\_/g,I._comment=m(E._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),I.emStrong.lDelim=m(I.emStrong.lDelim).replace(/punct/g,I._punctuation).getRegex(),I.emStrong.rDelimAst=m(I.emStrong.rDelimAst,"g").replace(/punct/g,I._punctuation).getRegex(),I.emStrong.rDelimUnd=m(I.emStrong.rDelimUnd,"g").replace(/punct/g,I._punctuation).getRegex(),I._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,I._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,I._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,I.autolink=m(I.autolink).replace("scheme",I._scheme).replace("email",I._email).getRegex(),I._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,I.tag=m(I.tag).replace("comment",I._comment).replace("attribute",I._attribute).getRegex(),I._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,I._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,I._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,I.link=m(I.link).replace("label",I._label).replace("href",I._href).replace("title",I._title).getRegex(),I.reflink=m(I.reflink).replace("label",I._label).replace("ref",E._label).getRegex(),I.nolink=m(I.nolink).replace("ref",E._label).getRegex(),I.reflinkSearch=m(I.reflinkSearch,"g").replace("reflink",I.reflink).replace("nolink",I.nolink).getRegex(),I.normal=z({},I),I.pedantic=z({},I.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:m(/^!?\[(label)\]\((.*?)\)/).replace("label",I._label).getRegex(),reflink:m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",I._label).getRegex()}),I.gfm=z({},I.normal,{escape:m(I.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),I.gfm.url=m(I.gfm.url,"i").replace("email",I.gfm._extended_email).getRegex(),I.breaks=z({},I.gfm,{br:m(I.br).replace("{2,}","*").getRegex(),text:m(I.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class L{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||s,this.options.tokenizer=this.options.tokenizer||new C,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:E.normal,inline:I.normal};this.options.pedantic?(t.block=E.pedantic,t.inline=I.pedantic):this.options.gfm&&(t.block=E.gfm,this.options.breaks?t.inline=I.breaks:t.inline=I.gfm),this.tokenizer.rules=t}static get rules(){return{block:E,inline:I}}static lex(e,t){return new L(t).lex(e)}static lexInline(e,t){return new L(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,i,s;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,i,s,l,o,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+R("a",s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,s.index)+"["+R("a",s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(a));)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(o=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,O))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,O))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i,D))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),l=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class P{constructor(e){this.options=e||s}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+p(r,!0)+'">'+(n?e:p(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:p(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=b(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+p(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=b(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class B{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class q{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class M{constructor(e){this.options=e||s,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new B,this.slugger=new q}static parse(e,t){return new M(t).parse(e)}static parseInline(e,t){return new M(t).parseInline(e)}parse(e,t=!0){let n,r,i,s,l,o,a,c,h,u,p,f,g,m,k,x,b,w,y,_="";const v=e.length;for(n=0;n<v;n++)if(u=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[u.type]&&(y=this.options.extensions.renderers[u.type].call({parser:this},u),!1!==y||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)))_+=y||"";else switch(u.type){case"space":continue;case"hr":_+=this.renderer.hr();continue;case"heading":_+=this.renderer.heading(this.parseInline(u.tokens),u.depth,d(this.parseInline(u.tokens,this.textRenderer)),this.slugger);continue;case"code":_+=this.renderer.code(u.text,u.lang,u.escaped);continue;case"table":for(c="",a="",s=u.header.length,r=0;r<s;r++)a+=this.renderer.tablecell(this.parseInline(u.header[r].tokens),{header:!0,align:u.align[r]});for(c+=this.renderer.tablerow(a),h="",s=u.rows.length,r=0;r<s;r++){for(o=u.rows[r],a="",l=o.length,i=0;i<l;i++)a+=this.renderer.tablecell(this.parseInline(o[i].tokens),{header:!1,align:u.align[i]});h+=this.renderer.tablerow(a)}_+=this.renderer.table(c,h);continue;case"blockquote":h=this.parse(u.tokens),_+=this.renderer.blockquote(h);continue;case"list":for(p=u.ordered,f=u.start,g=u.loose,s=u.items.length,h="",r=0;r<s;r++)k=u.items[r],x=k.checked,b=k.task,m="",k.task&&(w=this.renderer.checkbox(x),g?k.tokens.length>0&&"paragraph"===k.tokens[0].type?(k.tokens[0].text=w+" "+k.tokens[0].text,k.tokens[0].tokens&&k.tokens[0].tokens.length>0&&"text"===k.tokens[0].tokens[0].type&&(k.tokens[0].tokens[0].text=w+" "+k.tokens[0].tokens[0].text)):k.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(k.tokens,g),h+=this.renderer.listitem(m,b,x);_+=this.renderer.list(h,p,f);continue;case"html":_+=this.renderer.html(u.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(h=u.tokens?this.parseInline(u.tokens):u.text;n+1<v&&"text"===e[n+1].type;)u=e[++n],h+="\n"+(u.tokens?this.parseInline(u.tokens):u.text);_+=t?this.renderer.paragraph(h):h;continue;default:{const e='Token with "'+u.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return _}parseInline(e,t){t=t||this.renderer;let n,r,i,s="";const l=e.length;for(n=0;n<l;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(i=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==i||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))s+=i||"";else switch(r.type){case"escape":case"text":s+=t.text(r.text);break;case"html":s+=t.html(r.text);break;case"link":s+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":s+=t.image(r.href,r.title,r.text);break;case"strong":s+=t.strong(this.parseInline(r.tokens,t));break;case"em":s+=t.em(this.parseInline(r.tokens,t));break;case"codespan":s+=t.codespan(r.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return s}}function j(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),A(t=z({},j.defaults,t||{})),n){const r=t.highlight;let i;try{i=L.lex(e,t)}catch(e){return n(e)}const s=function(e){let s;if(!e)try{t.walkTokens&&j.walkTokens(i,t.walkTokens),s=M.parse(i,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,s)};if(!r||r.length<3)return s();if(delete t.highlight,!i.length)return s();let l=0;return j.walkTokens(i,(function(e){"code"===e.type&&(l++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return s(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),l--,0===l&&s()}))}),0))})),void(0===l&&s())}try{const n=L.lex(e,t);return t.walkTokens&&j.walkTokens(n,t.walkTokens),M.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+p(e.message+"",!0)+"</pre>";throw e}}j.options=j.setOptions=function(e){var t;return z(j.defaults,e),t=j.defaults,s=t,j},j.getDefaults=i,j.defaults=s,j.use=function(...e){const t=z({},...e),n=j.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach((e=>{if(e.extensions&&(r=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=j.defaults.renderer||new P;for(const t in e.renderer){const r=n[t];n[t]=(...i)=>{let s=e.renderer[t].apply(n,i);return!1===s&&(s=r.apply(n,i)),s}}t.renderer=n}if(e.tokenizer){const n=j.defaults.tokenizer||new C;for(const t in e.tokenizer){const r=n[t];n[t]=(...i)=>{let s=e.tokenizer[t].apply(n,i);return!1===s&&(s=r.apply(n,i)),s}}t.tokenizer=n}if(e.walkTokens){const n=j.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),j.setOptions(t)}))},j.walkTokens=function(e,t){for(const n of e)switch(t.call(j,n),n.type){case"table":for(const e of n.header)j.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)j.walkTokens(n.tokens,t);break;case"list":j.walkTokens(n.items,t);break;default:j.defaults.extensions&&j.defaults.extensions.childTokens&&j.defaults.extensions.childTokens[n.type]?j.defaults.extensions.childTokens[n.type].forEach((function(e){j.walkTokens(n[e],t)})):n.tokens&&j.walkTokens(n.tokens,t)}},j.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");A(t=z({},j.defaults,t||{}));try{const n=L.lexInline(e,t);return t.walkTokens&&j.walkTokens(n,t.walkTokens),M.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+p(e.message+"",!0)+"</pre>";throw e}},j.Parser=M,j.parser=M.parse,j.Renderer=P,j.TextRenderer=B,j.Lexer=L,j.lexer=L.lex,j.Tokenizer=C,j.Slugger=q,j.parse=j;j.options,j.setOptions,j.use,j.walkTokens,j.parseInline,M.parse,L.lex;function Z(e,t){return Array(t+1).join(e)}j.use({tokenizer:{autolink:()=>null,url:()=>null},renderer:{checkbox(...e){return Object.getPrototypeOf(this).checkbox.call(this,...e).trimRight()},code(...e){return Object.getPrototypeOf(this).code.call(this,...e).replace("\n</code>","</code>")}}});var F=["address","article","aside","audio","blockquote","body","canvas","center","dd","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","isindex","li","main","menu","nav","noframes","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul"];function H(e){return-1!==F.indexOf(e.nodeName.toLowerCase())}var U=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Q(e){return-1!==U.indexOf(e.nodeName.toLowerCase())}var V=U.join();var W={};function K(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function X(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(G(i,t,n))return i}}function G(e,t,n){var r=e.filter;if("string"==typeof r){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof r)throw new TypeError("`filter` needs to be a string, array, or function");if(r.call(e,t,n))return!0}}function Y(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function J(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}W.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},W.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},W.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var r=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&r<3?"\n\n"+e+"\n"+Z(1===r?"=":"-",e.length)+"\n\n":"\n\n"+Z("#",r)+" "+e+"\n\n"}},W.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},W.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},W.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var r=n.bulletListMarker+" ",i=t.parentNode;if("OL"===i.nodeName){var s=i.getAttribute("start"),l=Array.prototype.indexOf.call(i.children,t);r=(s?Number(s)+l:l+1)+". "}return r+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},W.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},W.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){for(var r,i=((t.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1],s=t.firstChild.textContent,l=n.fence.charAt(0),o=3,a=new RegExp("^"+l+"{3,}","gm");r=a.exec(s);)r[0].length>=o&&(o=r[0].length+1);var c=Z(l,o);return"\n\n"+c+i+"\n"+s.replace(/\n$/,"")+"\n"+c+"\n\n"}},W.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},W.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){return"["+e+"]("+t.getAttribute("href")+(t.title?' "'+t.title+'"':"")+")"}},W.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var r,i,s=t.getAttribute("href"),l=t.title?' "'+t.title+'"':"";switch(n.linkReferenceStyle){case"collapsed":r="["+e+"][]",i="["+e+"]: "+s+l;break;case"shortcut":r="["+e+"]",i="["+e+"]: "+s+l;break;default:var o=this.references.length+1;r="["+e+"]["+o+"]",i="["+o+"]: "+s+l}return this.references.push(i),r},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},W.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},W.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},W.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e.trim())return"";var t="`",n="",r="",i=e.match(/`+/gm);if(i)for(/^`/.test(e)&&(n=" "),/`$/.test(e)&&(r=" ");-1!==i.indexOf(t);)t+="`";return t+n+e+r+t}},W.image={filter:"img",replacement:function(e,t){var n=t.alt||"",r=t.getAttribute("src")||"",i=t.title||"";return r?"+")":""}},K.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=X(this.array,e,this.options))||(t=X(this._keep,e,this.options))||(t=X(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var ee="undefined"!=typeof window?window:{};var te,ne=function(){var e=ee.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?ee.DOMParser:function(){var e=function(){};return!function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?e.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t}:e.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t},e}();function re(e){var t;"string"==typeof e?t=(te=te||new ne).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):t=e.cloneNode(!0);return function(e){var t=e.element,n=e.isBlock,r=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!i(t)){for(var s=null,l=!1,o=null,a=J(o,t,i);a!==t;){if(3===a.nodeType||4===a.nodeType){var c=a.data.replace(/[ \r\n\t]+/g," ");if(s&&!/ $/.test(s.data)||l||" "!==c[0]||(c=c.substr(1)),!c){a=Y(a);continue}a.data=c,s=a}else{if(1!==a.nodeType){a=Y(a);continue}n(a)||"BR"===a.nodeName?(s&&(s.data=s.data.replace(/ $/,"")),s=null,l=!1):r(a)&&(s=null,l=!0)}var h=J(o,a,i);o=a,a=h}s&&(s.data=s.data.replace(/ $/,""),s.data||Y(s))}}({element:t,isBlock:H,isVoid:Q}),t}function ie(e){return e.isBlock=H(e),e.isCode="code"===e.nodeName.toLowerCase()||e.parentNode.isCode,e.isBlank=function(e){return-1===["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(e.nodeName)&&/^\s*$/i.test(e.textContent)&&!Q(e)&&!function(e){return e.querySelector&&e.querySelector(V)}(e)}(e),e.flankingWhitespace=function(e){var t="",n="";if(!e.isBlock){var r=/^\s/.test(e.textContent),i=/\s$/.test(e.textContent),s=e.isBlank&&r&&i;r&&!se("left",e)&&(t=" "),s||!i||se("right",e)||(n=" ")}return{leading:t,trailing:n}}(e),e}function se(e,t){var n,r,i;return"left"===e?(n=t.previousSibling,r=/ $/):(n=t.nextSibling,r=/^ /),n&&(3===n.nodeType?i=r.test(n.nodeValue):1!==n.nodeType||H(n)||(i=r.test(n.textContent))),i}var le=Array.prototype.reduce,oe=/^\n*/,ae=/\n*$/,ce=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function he(e){if(!(this instanceof he))return new he(e);var t={rules:W,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},t,e),this.rules=new K(this.options)}function ue(e){var t=this;return le.call(e.childNodes,(function(e,n){var r="";return 3===(n=new ie(n)).nodeType?r=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(r=fe.call(t,n)),de(e,r)}),"")}function pe(e){var t=this;return this.rules.forEach((function(n){"function"==typeof n.append&&(e=de(e,n.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function fe(e){var t=this.rules.forNode(e),n=ue.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function de(e,t){var n,r,i,s=(n=t,r=[e.match(ae)[0],n.match(oe)[0]].sort(),(i=r[r.length-1]).length<2?i:"\n\n");return(e=e.replace(ae,""))+s+(t=t.replace(oe,""))}he.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=ue.call(this,new re(e));return pe.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return ce.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};const ge=he;var me=/highlight-(?:text|source)-([a-z0-9]+)/;function ke(e){e.addRule("highlightedCodeBlock",{filter:function(e){var t=e.firstChild;return"DIV"===e.nodeName&&me.test(e.className)&&t&&"PRE"===t.nodeName},replacement:function(e,t,n){var r=((t.className||"").match(me)||[null,""])[1];return"\n\n"+n.fence+r+"\n"+t.firstChild.textContent+"\n"+n.fence+"\n\n"}})}function xe(e){e.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~"+e+"~"}})}var be=Array.prototype.indexOf,we=Array.prototype.every,ye={};function _e(e){var t,n,r=e.parentNode;return"THEAD"===r.nodeName||r.firstChild===e&&("TABLE"===r.nodeName||(n=(t=r).previousSibling,"TBODY"===t.nodeName&&(!n||"THEAD"===n.nodeName&&/^\s*$/i.test(n.textContent))))&&we.call(e.childNodes,(function(e){return"TH"===e.nodeName}))}function ve(e,t){var n=" ";return 0===be.call(t.parentNode.childNodes,t)&&(n="| "),n+e+" |"}function Se(e){for(var t in e.keep((function(e){return"TABLE"===e.nodeName&&!_e(e.rows[0])})),ye)e.addRule(t,ye[t])}function ze(e){e.addRule("taskListItems",{filter:function(e){return"checkbox"===e.type&&"LI"===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?"[x]":"[ ]")+" "}})}ye.tableCell={filter:["th","td"],replacement:function(e,t){return ve(e,t)}},ye.tableRow={filter:"tr",replacement:function(e,t){var n="",r={left:":--",right:"--:",center:":-:"};if(_e(t))for(var i=0;i<t.childNodes.length;i++){var s="---",l=(t.childNodes[i].getAttribute("align")||"").toLowerCase();l&&(s=r[l]||s),n+=ve(s,t.childNodes[i])}return"\n"+e+(n?"\n"+n:"")}},ye.table={filter:function(e){return"TABLE"===e.nodeName&&_e(e.rows[0])},replacement:function(e){return"\n\n"+(e=e.replace("\n\n","\n"))+"\n\n"}},ye.tableSection={filter:["thead","tbody","tfoot"],replacement:function(e){return e}};const $e=ge.prototype.escape;function Te(e){return e=(e=$e(e)).replace(/</g,"\\<")}ge.prototype.escape=function(e){let t="",n=0;for(const r of function*(e){for(const t of e.matchAll(Re)){const e=t[0],n=Ne(e);yield Object.assign([e.substring(0,n)],{index:t.index})}}(e)){const i=r.index;i>n&&(t+=Te(e.substring(n,i)));const s=r[0];t+=s,n=i+s.length}return n<e.length&&(t+=Te(e.substring(n,e.length))),t};const Ae=new ge({codeBlockStyle:"fenced",hr:"---",headingStyle:"atx"});Ae.use([function(e){e.use([ke,xe,Se,ze])},function(e){e.addRule("taskListItems",{filter:e=>"checkbox"===e.type&&("LI"===e.parentNode.nodeName||"LI"===e.parentNode.parentNode.nodeName),replacement:(e,t)=>(t.checked?"[x]":"[ ]")+" "})}]);const Re=new RegExp(/\b(?:(?:https?|ftp):\/\/|www\.)/.source+/(?![-_])(?:[-_a-z0-9\u00a1-\uffff]{1,63}\.)+(?:[a-z\u00a1-\uffff]{2,63})/.source+/(?:[^\s<>]*)/.source,"gi");function Ne(e){let t=e.length;for(;t>0;){const n=e[t-1];if("?!.,:*_~'\"".includes(n))t--;else{if(")"!=n)break;{let n=0;for(let r=0;r<t;r++)"("==e[r]?n++:")"==e[r]&&n--;if(!(n<0))break;t--}}}return t}class Ce{constructor(e){this._htmlDP=new t.HtmlDataProcessor(e)}keepHtml(e){Ae.keep([e])}toView(e){const t=(n=e,j.parse(n,{gfm:!0,breaks:!0,tables:!0,xhtml:!0,headerIds:!1}));var n;return this._htmlDP.toView(t)}toData(e){return function(e){return Ae.turndown(e)}(this._htmlDP.toData(e))}registerRawContentMatcher(e){this._htmlDP.registerRawContentMatcher(e)}useFillerType(){}}class Ee extends e.Plugin{constructor(e){super(e),e.data.processor=new Ce(e.data.viewDocument)}static get pluginName(){return"Markdown"}}var Ie=n(331);const De=["SPAN","BR","PRE","CODE"];class Oe extends e.Plugin{constructor(e){super(e),this._gfmDataProcessor=new Ce(e.data.viewDocument)}static get pluginName(){return"PasteFromMarkdownExperimental"}static get requires(){return[Ie.ClipboardPipeline]}init(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ClipboardPipeline");let r=!1;this.listenTo(t,"keydown",((e,t)=>{r=t.shiftKey})),this.listenTo(n,"inputTransformation",((e,t)=>{if(r)return;const n=t.dataTransfer.getData("text/html");if(!n){const e=t.dataTransfer.getData("text/plain");return void(t.content=this._gfmDataProcessor.toView(e))}const i=this._parseMarkdownFromHtml(n);i&&(t.content=this._gfmDataProcessor.toView(i))}))}_parseMarkdownFromHtml(e){const t=this._removeOsSpecificTags(e);if(!this._containsOnlyAllowedFirstLevelTags(t))return null;const n=this._removeFirstLevelWrapperTagsAndBrs(t);return this._containsAnyRemainingHtmlTags(n)?null:this._replaceHtmlReservedEntitiesWithCharacters(n)}_removeOsSpecificTags(e){return e.replace(/^<meta\b[^>]*>/,"").trim().replace(/^<html>/,"").replace(/<\/html>$/,"").trim().replace(/^<body>/,"").replace(/<\/body>$/,"").trim().replace(/^<!--StartFragment-->/,"").replace(/<!--EndFragment-->$/,"").trim()}_containsOnlyAllowedFirstLevelTags(e){const t=new DOMParser,{body:n}=t.parseFromString(e,"text/html");return Array.from(n.children).map((e=>e.tagName)).every((e=>De.includes(e)))}_removeFirstLevelWrapperTagsAndBrs(e){const t=new DOMParser,{body:n}=t.parseFromString(e,"text/html"),r=n.querySelectorAll("br");for(const e of r)e.replaceWith("\n");const i=n.querySelectorAll(":scope > *");for(const e of i){const t=e.cloneNode(!0);e.replaceWith(...t.childNodes)}return n.innerHTML}_containsAnyRemainingHtmlTags(e){return e.includes("<")}_replaceHtmlReservedEntitiesWithCharacters(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/ /g," ")}}})(),(window.CKEditor5=window.CKEditor5||{}).markdownGfm=r})();
|
package/dist/index.css
ADDED
package/dist/index.js
ADDED
@@ -0,0 +1,355 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
|
6
|
+
import { HtmlDataProcessor } from '@ckeditor/ckeditor5-engine/dist/index.js';
|
7
|
+
import { marked } from 'marked';
|
8
|
+
import TurndownService from 'turndown/lib/turndown.browser.es.js';
|
9
|
+
import { gfm } from 'turndown-plugin-gfm';
|
10
|
+
import { ClipboardPipeline } from '@ckeditor/ckeditor5-clipboard/dist/index.js';
|
11
|
+
|
12
|
+
// Overrides.
|
13
|
+
marked.use({
|
14
|
+
tokenizer: {
|
15
|
+
// Disable the autolink rule in the lexer.
|
16
|
+
autolink: ()=>null,
|
17
|
+
url: ()=>null
|
18
|
+
},
|
19
|
+
renderer: {
|
20
|
+
checkbox (...args) {
|
21
|
+
// Remove bogus space after <input type="checkbox"> because it would be preserved
|
22
|
+
// by DomConverter as it's next to an inline object.
|
23
|
+
return Object.getPrototypeOf(this).checkbox.call(this, ...args).trimRight();
|
24
|
+
},
|
25
|
+
code (...args) {
|
26
|
+
// Since marked v1.2.8, every <code> gets a trailing "\n" whether it originally
|
27
|
+
// ended with one or not (see https://github.com/markedjs/marked/issues/1884 to learn why).
|
28
|
+
// This results in a redundant soft break in the model when loaded into the editor, which
|
29
|
+
// is best prevented at this stage. See https://github.com/ckeditor/ckeditor5/issues/11124.
|
30
|
+
return Object.getPrototypeOf(this).code.call(this, ...args).replace('\n</code>', '</code>');
|
31
|
+
}
|
32
|
+
}
|
33
|
+
});
|
34
|
+
/**
|
35
|
+
* Parses markdown string to an HTML.
|
36
|
+
*/ function markdown2html(markdown) {
|
37
|
+
const options = {
|
38
|
+
gfm: true,
|
39
|
+
breaks: true,
|
40
|
+
tables: true,
|
41
|
+
xhtml: true,
|
42
|
+
headerIds: false
|
43
|
+
};
|
44
|
+
return marked.parse(markdown, options);
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
49
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
50
|
+
*/ /**
|
51
|
+
* @module markdown-gfm/html2markdown/html2markdown
|
52
|
+
*/ /* eslint-disable @typescript-eslint/ban-ts-comment */ // Importing types for this package is problematic, so it's omitted.
|
53
|
+
// @ts-ignore
|
54
|
+
// Override the original escape method by not escaping links.
|
55
|
+
const originalEscape = TurndownService.prototype.escape;
|
56
|
+
function escape(string) {
|
57
|
+
string = originalEscape(string);
|
58
|
+
// Escape "<".
|
59
|
+
string = string.replace(/</g, '\\<');
|
60
|
+
return string;
|
61
|
+
}
|
62
|
+
TurndownService.prototype.escape = function(string) {
|
63
|
+
// Urls should not be escaped. Our strategy is using a regex to find them and escape everything
|
64
|
+
// which is out of the matches parts.
|
65
|
+
let escaped = '';
|
66
|
+
let lastLinkEnd = 0;
|
67
|
+
for (const match of matchAutolink(string)){
|
68
|
+
const index = match.index;
|
69
|
+
// Append the substring between the last match and the current one (if anything).
|
70
|
+
if (index > lastLinkEnd) {
|
71
|
+
escaped += escape(string.substring(lastLinkEnd, index));
|
72
|
+
}
|
73
|
+
const matchedURL = match[0];
|
74
|
+
escaped += matchedURL;
|
75
|
+
lastLinkEnd = index + matchedURL.length;
|
76
|
+
}
|
77
|
+
// Add text after the last link or at the string start if no matches.
|
78
|
+
if (lastLinkEnd < string.length) {
|
79
|
+
escaped += escape(string.substring(lastLinkEnd, string.length));
|
80
|
+
}
|
81
|
+
return escaped;
|
82
|
+
};
|
83
|
+
const turndownService = new TurndownService({
|
84
|
+
codeBlockStyle: 'fenced',
|
85
|
+
hr: '---',
|
86
|
+
headingStyle: 'atx'
|
87
|
+
});
|
88
|
+
turndownService.use([
|
89
|
+
gfm,
|
90
|
+
todoList
|
91
|
+
]);
|
92
|
+
/**
|
93
|
+
* Parses HTML to a markdown.
|
94
|
+
*/ function html2markdown(html) {
|
95
|
+
return turndownService.turndown(html);
|
96
|
+
}
|
97
|
+
// This is a copy of the original taskListItems rule from turdown-plugin-gfm, with minor changes.
|
98
|
+
function todoList(turndownService) {
|
99
|
+
turndownService.addRule('taskListItems', {
|
100
|
+
filter (node) {
|
101
|
+
return node.type === 'checkbox' && // Changes here as CKEditor outputs a deeper structure.
|
102
|
+
(node.parentNode.nodeName === 'LI' || node.parentNode.parentNode.nodeName === 'LI');
|
103
|
+
},
|
104
|
+
replacement (content, node) {
|
105
|
+
return (node.checked ? '[x]' : '[ ]') + ' ';
|
106
|
+
}
|
107
|
+
});
|
108
|
+
}
|
109
|
+
// Autolink matcher.
|
110
|
+
const regex = new RegExp(// Prefix.
|
111
|
+
/\b(?:(?:https?|ftp):\/\/|www\.)/.source + // Domain name.
|
112
|
+
/(?![-_])(?:[-_a-z0-9\u00a1-\uffff]{1,63}\.)+(?:[a-z\u00a1-\uffff]{2,63})/.source + // The rest.
|
113
|
+
/(?:[^\s<>]*)/.source, 'gi');
|
114
|
+
/**
|
115
|
+
* Trimming end of link.
|
116
|
+
* https://github.github.com/gfm/#autolinks-extension-
|
117
|
+
*/ function* matchAutolink(string) {
|
118
|
+
for (const match of string.matchAll(regex)){
|
119
|
+
const matched = match[0];
|
120
|
+
const length = autolinkFindEnd(matched);
|
121
|
+
yield Object.assign([
|
122
|
+
matched.substring(0, length)
|
123
|
+
], {
|
124
|
+
index: match.index
|
125
|
+
});
|
126
|
+
// We could adjust regex.lastIndex but it's not needed because what we skipped is for sure not a valid URL.
|
127
|
+
}
|
128
|
+
}
|
129
|
+
/**
|
130
|
+
* Returns the new length of the link (after it would trim trailing characters).
|
131
|
+
*/ function autolinkFindEnd(string) {
|
132
|
+
let length = string.length;
|
133
|
+
while(length > 0){
|
134
|
+
const char = string[length - 1];
|
135
|
+
if ('?!.,:*_~\'"'.includes(char)) {
|
136
|
+
length--;
|
137
|
+
} else if (char == ')') {
|
138
|
+
let openBrackets = 0;
|
139
|
+
for(let i = 0; i < length; i++){
|
140
|
+
if (string[i] == '(') {
|
141
|
+
openBrackets++;
|
142
|
+
} else if (string[i] == ')') {
|
143
|
+
openBrackets--;
|
144
|
+
}
|
145
|
+
}
|
146
|
+
// If there is fewer opening brackets then closing ones we should remove a closing bracket.
|
147
|
+
if (openBrackets < 0) {
|
148
|
+
length--;
|
149
|
+
} else {
|
150
|
+
break;
|
151
|
+
}
|
152
|
+
} else {
|
153
|
+
break;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
return length;
|
157
|
+
}
|
158
|
+
|
159
|
+
class GFMDataProcessor {
|
160
|
+
/**
|
161
|
+
* Keeps the specified element in the output as HTML. This is useful if the editor contains
|
162
|
+
* features producing HTML that is not a part of the Markdown standard.
|
163
|
+
*
|
164
|
+
* By default, all HTML tags are removed.
|
165
|
+
*
|
166
|
+
* @param element The element name to be kept.
|
167
|
+
*/ keepHtml(element) {
|
168
|
+
turndownService.keep([
|
169
|
+
element
|
170
|
+
]);
|
171
|
+
}
|
172
|
+
/**
|
173
|
+
* Converts the provided Markdown string to a view tree.
|
174
|
+
*
|
175
|
+
* @param data A Markdown string.
|
176
|
+
* @returns The converted view element.
|
177
|
+
*/ toView(data) {
|
178
|
+
const html = markdown2html(data);
|
179
|
+
return this._htmlDP.toView(html);
|
180
|
+
}
|
181
|
+
/**
|
182
|
+
* Converts the provided {@link module:engine/view/documentfragment~DocumentFragment} to data format – in this
|
183
|
+
* case to a Markdown string.
|
184
|
+
*
|
185
|
+
* @returns Markdown string.
|
186
|
+
*/ toData(viewFragment) {
|
187
|
+
const html = this._htmlDP.toData(viewFragment);
|
188
|
+
return html2markdown(html);
|
189
|
+
}
|
190
|
+
/**
|
191
|
+
* Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
|
192
|
+
* and not processed during the conversion from Markdown to view elements.
|
193
|
+
*
|
194
|
+
* The raw data can be later accessed by a
|
195
|
+
* {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
|
196
|
+
*
|
197
|
+
* @param pattern The pattern matching all view elements whose content should
|
198
|
+
* be treated as raw data.
|
199
|
+
*/ registerRawContentMatcher(pattern) {
|
200
|
+
this._htmlDP.registerRawContentMatcher(pattern);
|
201
|
+
}
|
202
|
+
/**
|
203
|
+
* This method does not have any effect on the data processor result. It exists for compatibility with the
|
204
|
+
* {@link module:engine/dataprocessor/dataprocessor~DataProcessor `DataProcessor` interface}.
|
205
|
+
*/ useFillerType() {}
|
206
|
+
/**
|
207
|
+
* Creates a new instance of the Markdown data processor class.
|
208
|
+
*/ constructor(document){
|
209
|
+
this._htmlDP = new HtmlDataProcessor(document);
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
class Markdown extends Plugin {
|
214
|
+
/**
|
215
|
+
* @inheritDoc
|
216
|
+
*/ static get pluginName() {
|
217
|
+
return 'Markdown';
|
218
|
+
}
|
219
|
+
/**
|
220
|
+
* @inheritDoc
|
221
|
+
*/ constructor(editor){
|
222
|
+
super(editor);
|
223
|
+
editor.data.processor = new GFMDataProcessor(editor.data.viewDocument);
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
const ALLOWED_MARKDOWN_FIRST_LEVEL_TAGS = [
|
228
|
+
'SPAN',
|
229
|
+
'BR',
|
230
|
+
'PRE',
|
231
|
+
'CODE'
|
232
|
+
];
|
233
|
+
class PasteFromMarkdownExperimental extends Plugin {
|
234
|
+
/**
|
235
|
+
* @inheritDoc
|
236
|
+
*/ static get pluginName() {
|
237
|
+
return 'PasteFromMarkdownExperimental';
|
238
|
+
}
|
239
|
+
/**
|
240
|
+
* @inheritDoc
|
241
|
+
*/ static get requires() {
|
242
|
+
return [
|
243
|
+
ClipboardPipeline
|
244
|
+
];
|
245
|
+
}
|
246
|
+
/**
|
247
|
+
* @inheritDoc
|
248
|
+
*/ init() {
|
249
|
+
const editor = this.editor;
|
250
|
+
const view = editor.editing.view;
|
251
|
+
const viewDocument = view.document;
|
252
|
+
const clipboardPipeline = editor.plugins.get('ClipboardPipeline');
|
253
|
+
let shiftPressed = false;
|
254
|
+
this.listenTo(viewDocument, 'keydown', (evt, data)=>{
|
255
|
+
shiftPressed = data.shiftKey;
|
256
|
+
});
|
257
|
+
this.listenTo(clipboardPipeline, 'inputTransformation', (evt, data)=>{
|
258
|
+
if (shiftPressed) {
|
259
|
+
return;
|
260
|
+
}
|
261
|
+
const dataAsTextHtml = data.dataTransfer.getData('text/html');
|
262
|
+
if (!dataAsTextHtml) {
|
263
|
+
const dataAsTextPlain = data.dataTransfer.getData('text/plain');
|
264
|
+
data.content = this._gfmDataProcessor.toView(dataAsTextPlain);
|
265
|
+
return;
|
266
|
+
}
|
267
|
+
const markdownFromHtml = this._parseMarkdownFromHtml(dataAsTextHtml);
|
268
|
+
if (markdownFromHtml) {
|
269
|
+
data.content = this._gfmDataProcessor.toView(markdownFromHtml);
|
270
|
+
}
|
271
|
+
});
|
272
|
+
}
|
273
|
+
/**
|
274
|
+
* Determines if the code copied from a website in the `text/html` type can be parsed as Markdown.
|
275
|
+
* It removes any OS-specific HTML tags, for example, <meta> on macOS and <!--StartFragment--> on Windows.
|
276
|
+
* Then removes a single wrapper HTML tag or wrappers for sibling tags, and if there are no more tags left,
|
277
|
+
* returns the remaining text. Returns null if there are any remaining HTML tags detected.
|
278
|
+
*
|
279
|
+
* @param htmlString Clipboard content in the `text/html` type format.
|
280
|
+
*/ _parseMarkdownFromHtml(htmlString) {
|
281
|
+
const withoutOsSpecificTags = this._removeOsSpecificTags(htmlString);
|
282
|
+
if (!this._containsOnlyAllowedFirstLevelTags(withoutOsSpecificTags)) {
|
283
|
+
return null;
|
284
|
+
}
|
285
|
+
const withoutWrapperTag = this._removeFirstLevelWrapperTagsAndBrs(withoutOsSpecificTags);
|
286
|
+
if (this._containsAnyRemainingHtmlTags(withoutWrapperTag)) {
|
287
|
+
return null;
|
288
|
+
}
|
289
|
+
return this._replaceHtmlReservedEntitiesWithCharacters(withoutWrapperTag);
|
290
|
+
}
|
291
|
+
/**
|
292
|
+
* Removes OS-specific tags.
|
293
|
+
*
|
294
|
+
* @param htmlString Clipboard content in the `text/html` type format.
|
295
|
+
*/ _removeOsSpecificTags(htmlString) {
|
296
|
+
// Removing the <meta> tag present on Mac.
|
297
|
+
const withoutMetaTag = htmlString.replace(/^<meta\b[^>]*>/, '').trim();
|
298
|
+
// Removing the <html> tag present on Windows.
|
299
|
+
const withoutHtmlTag = withoutMetaTag.replace(/^<html>/, '').replace(/<\/html>$/, '').trim();
|
300
|
+
// Removing the <body> tag present on Windows.
|
301
|
+
const withoutBodyTag = withoutHtmlTag.replace(/^<body>/, '').replace(/<\/body>$/, '').trim();
|
302
|
+
// Removing the <!--StartFragment--> tag present on Windows.
|
303
|
+
return withoutBodyTag.replace(/^<!--StartFragment-->/, '').replace(/<!--EndFragment-->$/, '').trim();
|
304
|
+
}
|
305
|
+
/**
|
306
|
+
* If the input HTML string contains any first-level formatting tags
|
307
|
+
* like <b>, <strong>, or <i>, we should not treat it as Markdown.
|
308
|
+
*
|
309
|
+
* @param htmlString Clipboard content.
|
310
|
+
*/ _containsOnlyAllowedFirstLevelTags(htmlString) {
|
311
|
+
const parser = new DOMParser();
|
312
|
+
const { body: tempElement } = parser.parseFromString(htmlString, 'text/html');
|
313
|
+
const tagNames = Array.from(tempElement.children).map((el)=>el.tagName);
|
314
|
+
return tagNames.every((el)=>ALLOWED_MARKDOWN_FIRST_LEVEL_TAGS.includes(el));
|
315
|
+
}
|
316
|
+
/**
|
317
|
+
* Removes multiple HTML wrapper tags from a list of sibling HTML tags.
|
318
|
+
*
|
319
|
+
* @param htmlString Clipboard content without any OS-specific tags.
|
320
|
+
*/ _removeFirstLevelWrapperTagsAndBrs(htmlString) {
|
321
|
+
const parser = new DOMParser();
|
322
|
+
const { body: tempElement } = parser.parseFromString(htmlString, 'text/html');
|
323
|
+
const brElements = tempElement.querySelectorAll('br');
|
324
|
+
for (const br of brElements){
|
325
|
+
br.replaceWith('\n');
|
326
|
+
}
|
327
|
+
const outerElements = tempElement.querySelectorAll(':scope > *');
|
328
|
+
for (const element of outerElements){
|
329
|
+
const elementClone = element.cloneNode(true);
|
330
|
+
element.replaceWith(...elementClone.childNodes);
|
331
|
+
}
|
332
|
+
return tempElement.innerHTML;
|
333
|
+
}
|
334
|
+
/**
|
335
|
+
* Determines if a string contains any HTML tags.
|
336
|
+
*/ _containsAnyRemainingHtmlTags(str) {
|
337
|
+
return str.includes('<');
|
338
|
+
}
|
339
|
+
/**
|
340
|
+
* Replaces the reserved HTML entities with the actual characters.
|
341
|
+
*
|
342
|
+
* @param htmlString Clipboard content without any tags.
|
343
|
+
*/ _replaceHtmlReservedEntitiesWithCharacters(htmlString) {
|
344
|
+
return htmlString.replace(/>/g, '>').replace(/</g, '<').replace(/ /g, ' ');
|
345
|
+
}
|
346
|
+
/**
|
347
|
+
* @inheritDoc
|
348
|
+
*/ constructor(editor){
|
349
|
+
super(editor);
|
350
|
+
this._gfmDataProcessor = new GFMDataProcessor(editor.data.viewDocument);
|
351
|
+
}
|
352
|
+
}
|
353
|
+
|
354
|
+
export { Markdown, PasteFromMarkdownExperimental };
|
355
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["index.js","../src/markdown2html/markdown2html.ts","../src/html2markdown/html2markdown.ts","../src/gfmdataprocessor.ts","../src/markdown.ts","../src/pastefrommarkdownexperimental.ts"],"names":["marked","use","tokenizer","autolink","url","renderer","checkbox","args","Object","getPrototypeOf","call","trimRight","code","replace","markdown2html","markdown","options","gfm","breaks","tables","xhtml","headerIds","parse","originalEscape","TurndownService","prototype","escape","string","escaped","lastLinkEnd","match","matchAutolink","index","substring","matchedURL","length","turndownService","codeBlockStyle","hr","headingStyle","todoList","html2markdown","html","turndown","addRule","filter","node","type","parentNode","nodeName","replacement","content","checked","regex","RegExp","source","matchAll","matched","autolinkFindEnd","assign","char","includes","openBrackets","i","GFMDataProcessor","keepHtml","element","keep","toView","data","_htmlDP","toData","viewFragment","registerRawContentMatcher","pattern","useFillerType","constructor","document","HtmlDataProcessor","Markdown","Plugin","pluginName","editor","processor","viewDocument","ALLOWED_MARKDOWN_FIRST_LEVEL_TAGS","PasteFromMarkdownExperimental","requires","ClipboardPipeline","init","view","editing","clipboardPipeline","plugins","get","shiftPressed","listenTo","evt","shiftKey","dataAsTextHtml","dataTransfer","getData","dataAsTextPlain","_gfmDataProcessor","markdownFromHtml","_parseMarkdownFromHtml","htmlString","withoutOsSpecificTags","_removeOsSpecificTags","_containsOnlyAllowedFirstLevelTags","withoutWrapperTag","_removeFirstLevelWrapperTagsAndBrs","_containsAnyRemainingHtmlTags","_replaceHtmlReservedEntitiesWithCharacters","withoutMetaTag","trim","withoutHtmlTag","withoutBodyTag","parser","DOMParser","body","tempElement","parseFromString","tagNames","Array","from","children","map","el","tagName","every","brElements","querySelectorAll","br","replaceWith","outerElements","elementClone","cloneNode","childNodes","innerHTML","str"],"mappings":";;;;AAAA,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAChE,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC7E,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAChC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,OAA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CAAA,CAAA,CAAA,CAAA,CAAA;AACvB,CAAA,CAAA,CAAA,CAAA,CAAA;AAhKA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AL2TD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU;AAClB,CKzTC+D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,WAAAA,CAAaM,MAAc,CAAA,CAAA;AAC1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAK,CAAEA,MAAAA,CAAAA,CAAAA;AL0TT,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CKxTL,IAAI,CAACqB,iBAAiB,CAAA,CAAA,CAAG,GAAIvC,CAAAA,gBAAAA,CAAkBkB,MAAOb,CAAAA,IAAI,CAACe,YAAY,CAAA,CAAA;AACxE,CAAA,CAAA,CAAA,CAAA,CAAA;AA0JA,CAAA;ALgKD;AACA,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG","file":"index.js.map","sourcesContent":["import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';\nimport { HtmlDataProcessor } from '@ckeditor/ckeditor5-engine/dist/index.js';\nimport { marked } from 'marked';\nimport TurndownService from 'turndown/lib/turndown.browser.es.js';\nimport { gfm } from 'turndown-plugin-gfm';\nimport { ClipboardPipeline } from '@ckeditor/ckeditor5-clipboard/dist/index.js';\n\n// Overrides.\nmarked.use({\n tokenizer: {\n // Disable the autolink rule in the lexer.\n autolink: ()=>null,\n url: ()=>null\n },\n renderer: {\n checkbox (...args) {\n // Remove bogus space after <input type=\"checkbox\"> because it would be preserved\n // by DomConverter as it's next to an inline object.\n return Object.getPrototypeOf(this).checkbox.call(this, ...args).trimRight();\n },\n code (...args) {\n // Since marked v1.2.8, every <code> gets a trailing \"\\n\" whether it originally\n // ended with one or not (see https://github.com/markedjs/marked/issues/1884 to learn why).\n // This results in a redundant soft break in the model when loaded into the editor, which\n // is best prevented at this stage. See https://github.com/ckeditor/ckeditor5/issues/11124.\n return Object.getPrototypeOf(this).code.call(this, ...args).replace('\\n</code>', '</code>');\n }\n }\n});\n/**\n * Parses markdown string to an HTML.\n */ function markdown2html(markdown) {\n const options = {\n gfm: true,\n breaks: true,\n tables: true,\n xhtml: true,\n headerIds: false\n };\n return marked.parse(markdown, options);\n}\n\n/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */ /**\n * @module markdown-gfm/html2markdown/html2markdown\n */ /* eslint-disable @typescript-eslint/ban-ts-comment */ // Importing types for this package is problematic, so it's omitted.\n// @ts-ignore\n// Override the original escape method by not escaping links.\nconst originalEscape = TurndownService.prototype.escape;\nfunction escape(string) {\n string = originalEscape(string);\n // Escape \"<\".\n string = string.replace(/</g, '\\\\<');\n return string;\n}\nTurndownService.prototype.escape = function(string) {\n // Urls should not be escaped. Our strategy is using a regex to find them and escape everything\n // which is out of the matches parts.\n let escaped = '';\n let lastLinkEnd = 0;\n for (const match of matchAutolink(string)){\n const index = match.index;\n // Append the substring between the last match and the current one (if anything).\n if (index > lastLinkEnd) {\n escaped += escape(string.substring(lastLinkEnd, index));\n }\n const matchedURL = match[0];\n escaped += matchedURL;\n lastLinkEnd = index + matchedURL.length;\n }\n // Add text after the last link or at the string start if no matches.\n if (lastLinkEnd < string.length) {\n escaped += escape(string.substring(lastLinkEnd, string.length));\n }\n return escaped;\n};\nconst turndownService = new TurndownService({\n codeBlockStyle: 'fenced',\n hr: '---',\n headingStyle: 'atx'\n});\nturndownService.use([\n gfm,\n todoList\n]);\n/**\n * Parses HTML to a markdown.\n */ function html2markdown(html) {\n return turndownService.turndown(html);\n}\n// This is a copy of the original taskListItems rule from turdown-plugin-gfm, with minor changes.\nfunction todoList(turndownService) {\n turndownService.addRule('taskListItems', {\n filter (node) {\n return node.type === 'checkbox' && // Changes here as CKEditor outputs a deeper structure.\n (node.parentNode.nodeName === 'LI' || node.parentNode.parentNode.nodeName === 'LI');\n },\n replacement (content, node) {\n return (node.checked ? '[x]' : '[ ]') + ' ';\n }\n });\n}\n// Autolink matcher.\nconst regex = new RegExp(// Prefix.\n/\\b(?:(?:https?|ftp):\\/\\/|www\\.)/.source + // Domain name.\n/(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})/.source + // The rest.\n/(?:[^\\s<>]*)/.source, 'gi');\n/**\n * Trimming end of link.\n * https://github.github.com/gfm/#autolinks-extension-\n */ function* matchAutolink(string) {\n for (const match of string.matchAll(regex)){\n const matched = match[0];\n const length = autolinkFindEnd(matched);\n yield Object.assign([\n matched.substring(0, length)\n ], {\n index: match.index\n });\n // We could adjust regex.lastIndex but it's not needed because what we skipped is for sure not a valid URL.\n }\n}\n/**\n * Returns the new length of the link (after it would trim trailing characters).\n */ function autolinkFindEnd(string) {\n let length = string.length;\n while(length > 0){\n const char = string[length - 1];\n if ('?!.,:*_~\\'\"'.includes(char)) {\n length--;\n } else if (char == ')') {\n let openBrackets = 0;\n for(let i = 0; i < length; i++){\n if (string[i] == '(') {\n openBrackets++;\n } else if (string[i] == ')') {\n openBrackets--;\n }\n }\n // If there is fewer opening brackets then closing ones we should remove a closing bracket.\n if (openBrackets < 0) {\n length--;\n } else {\n break;\n }\n } else {\n break;\n }\n }\n return length;\n}\n\nclass GFMDataProcessor {\n /**\n * Keeps the specified element in the output as HTML. This is useful if the editor contains\n * features producing HTML that is not a part of the Markdown standard.\n *\n * By default, all HTML tags are removed.\n *\n * @param element The element name to be kept.\n */ keepHtml(element) {\n turndownService.keep([\n element\n ]);\n }\n /**\n * Converts the provided Markdown string to a view tree.\n *\n * @param data A Markdown string.\n * @returns The converted view element.\n */ toView(data) {\n const html = markdown2html(data);\n return this._htmlDP.toView(html);\n }\n /**\n * Converts the provided {@link module:engine/view/documentfragment~DocumentFragment} to data format – in this\n * case to a Markdown string.\n *\n * @returns Markdown string.\n */ toData(viewFragment) {\n const html = this._htmlDP.toData(viewFragment);\n return html2markdown(html);\n }\n /**\n * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data\n * and not processed during the conversion from Markdown to view elements.\n *\n * The raw data can be later accessed by a\n * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `\"$rawContent\"`.\n *\n * @param pattern The pattern matching all view elements whose content should\n * be treated as raw data.\n */ registerRawContentMatcher(pattern) {\n this._htmlDP.registerRawContentMatcher(pattern);\n }\n /**\n * This method does not have any effect on the data processor result. It exists for compatibility with the\n * {@link module:engine/dataprocessor/dataprocessor~DataProcessor `DataProcessor` interface}.\n */ useFillerType() {}\n /**\n * Creates a new instance of the Markdown data processor class.\n */ constructor(document){\n this._htmlDP = new HtmlDataProcessor(document);\n }\n}\n\nclass Markdown extends Plugin {\n /**\n * @inheritDoc\n */ static get pluginName() {\n return 'Markdown';\n }\n /**\n * @inheritDoc\n */ constructor(editor){\n super(editor);\n editor.data.processor = new GFMDataProcessor(editor.data.viewDocument);\n }\n}\n\nconst ALLOWED_MARKDOWN_FIRST_LEVEL_TAGS = [\n 'SPAN',\n 'BR',\n 'PRE',\n 'CODE'\n];\nclass PasteFromMarkdownExperimental extends Plugin {\n /**\n * @inheritDoc\n */ static get pluginName() {\n return 'PasteFromMarkdownExperimental';\n }\n /**\n * @inheritDoc\n */ static get requires() {\n return [\n ClipboardPipeline\n ];\n }\n /**\n * @inheritDoc\n */ init() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n let shiftPressed = false;\n this.listenTo(viewDocument, 'keydown', (evt, data)=>{\n shiftPressed = data.shiftKey;\n });\n this.listenTo(clipboardPipeline, 'inputTransformation', (evt, data)=>{\n if (shiftPressed) {\n return;\n }\n const dataAsTextHtml = data.dataTransfer.getData('text/html');\n if (!dataAsTextHtml) {\n const dataAsTextPlain = data.dataTransfer.getData('text/plain');\n data.content = this._gfmDataProcessor.toView(dataAsTextPlain);\n return;\n }\n const markdownFromHtml = this._parseMarkdownFromHtml(dataAsTextHtml);\n if (markdownFromHtml) {\n data.content = this._gfmDataProcessor.toView(markdownFromHtml);\n }\n });\n }\n /**\n * Determines if the code copied from a website in the `text/html` type can be parsed as Markdown.\n * It removes any OS-specific HTML tags, for example, <meta> on macOS and <!--StartFragment--> on Windows.\n * Then removes a single wrapper HTML tag or wrappers for sibling tags, and if there are no more tags left,\n * returns the remaining text. Returns null if there are any remaining HTML tags detected.\n *\n * @param htmlString Clipboard content in the `text/html` type format.\n */ _parseMarkdownFromHtml(htmlString) {\n const withoutOsSpecificTags = this._removeOsSpecificTags(htmlString);\n if (!this._containsOnlyAllowedFirstLevelTags(withoutOsSpecificTags)) {\n return null;\n }\n const withoutWrapperTag = this._removeFirstLevelWrapperTagsAndBrs(withoutOsSpecificTags);\n if (this._containsAnyRemainingHtmlTags(withoutWrapperTag)) {\n return null;\n }\n return this._replaceHtmlReservedEntitiesWithCharacters(withoutWrapperTag);\n }\n /**\n * Removes OS-specific tags.\n *\n * @param htmlString Clipboard content in the `text/html` type format.\n */ _removeOsSpecificTags(htmlString) {\n // Removing the <meta> tag present on Mac.\n const withoutMetaTag = htmlString.replace(/^<meta\\b[^>]*>/, '').trim();\n // Removing the <html> tag present on Windows.\n const withoutHtmlTag = withoutMetaTag.replace(/^<html>/, '').replace(/<\\/html>$/, '').trim();\n // Removing the <body> tag present on Windows.\n const withoutBodyTag = withoutHtmlTag.replace(/^<body>/, '').replace(/<\\/body>$/, '').trim();\n // Removing the <!--StartFragment--> tag present on Windows.\n return withoutBodyTag.replace(/^<!--StartFragment-->/, '').replace(/<!--EndFragment-->$/, '').trim();\n }\n /**\n * If the input HTML string contains any first-level formatting tags\n * like <b>, <strong>, or <i>, we should not treat it as Markdown.\n *\n * @param htmlString Clipboard content.\n */ _containsOnlyAllowedFirstLevelTags(htmlString) {\n const parser = new DOMParser();\n const { body: tempElement } = parser.parseFromString(htmlString, 'text/html');\n const tagNames = Array.from(tempElement.children).map((el)=>el.tagName);\n return tagNames.every((el)=>ALLOWED_MARKDOWN_FIRST_LEVEL_TAGS.includes(el));\n }\n /**\n * Removes multiple HTML wrapper tags from a list of sibling HTML tags.\n *\n * @param htmlString Clipboard content without any OS-specific tags.\n */ _removeFirstLevelWrapperTagsAndBrs(htmlString) {\n const parser = new DOMParser();\n const { body: tempElement } = parser.parseFromString(htmlString, 'text/html');\n const brElements = tempElement.querySelectorAll('br');\n for (const br of brElements){\n br.replaceWith('\\n');\n }\n const outerElements = tempElement.querySelectorAll(':scope > *');\n for (const element of outerElements){\n const elementClone = element.cloneNode(true);\n element.replaceWith(...elementClone.childNodes);\n }\n return tempElement.innerHTML;\n }\n /**\n * Determines if a string contains any HTML tags.\n */ _containsAnyRemainingHtmlTags(str) {\n return str.includes('<');\n }\n /**\n * Replaces the reserved HTML entities with the actual characters.\n *\n * @param htmlString Clipboard content without any tags.\n */ _replaceHtmlReservedEntitiesWithCharacters(htmlString) {\n return htmlString.replace(/>/g, '>').replace(/</g, '<').replace(/ /g, ' ');\n }\n /**\n * @inheritDoc\n */ constructor(editor){\n super(editor);\n this._gfmDataProcessor = new GFMDataProcessor(editor.data.viewDocument);\n }\n}\n\nexport { Markdown, PasteFromMarkdownExperimental };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module markdown-gfm/markdown2html/markdown2html\n */\n\nimport { marked } from 'marked';\n\n// Overrides.\nmarked.use( {\n\ttokenizer: {\n\t\t// Disable the autolink rule in the lexer.\n\t\tautolink: () => null as any,\n\t\turl: () => null as any\n\t},\n\trenderer: {\n\t\tcheckbox( ...args: Array<any> ) {\n\t\t\t// Remove bogus space after <input type=\"checkbox\"> because it would be preserved\n\t\t\t// by DomConverter as it's next to an inline object.\n\t\t\treturn Object.getPrototypeOf( this ).checkbox.call( this, ...args ).trimRight();\n\t\t},\n\n\t\tcode( ...args: Array<any> ) {\n\t\t\t// Since marked v1.2.8, every <code> gets a trailing \"\\n\" whether it originally\n\t\t\t// ended with one or not (see https://github.com/markedjs/marked/issues/1884 to learn why).\n\t\t\t// This results in a redundant soft break in the model when loaded into the editor, which\n\t\t\t// is best prevented at this stage. See https://github.com/ckeditor/ckeditor5/issues/11124.\n\t\t\treturn Object.getPrototypeOf( this ).code.call( this, ...args ).replace( '\\n</code>', '</code>' );\n\t\t}\n\t}\n} );\n\n/**\n * Parses markdown string to an HTML.\n */\nexport default function markdown2html( markdown: string ): string {\n\tconst options = {\n\t\tgfm: true,\n\t\tbreaks: true,\n\t\ttables: true,\n\t\txhtml: true,\n\t\theaderIds: false\n\t};\n\n\treturn marked.parse( markdown, options );\n}\n\nexport { marked };\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module markdown-gfm/html2markdown/html2markdown\n */\n\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n\n// Importing types for this package is problematic, so it's omitted.\n// @ts-ignore\nimport TurndownService from 'turndown/lib/turndown.browser.es.js';\n\n// There no avaialble types for 'turndown-plugin-gfm' module and it's not worth to generate them on our own.\n// @ts-ignore\nimport { gfm } from 'turndown-plugin-gfm';\n\n// Override the original escape method by not escaping links.\nconst originalEscape = TurndownService.prototype.escape;\n\nfunction escape( string: string ): string {\n\tstring = originalEscape( string );\n\n\t// Escape \"<\".\n\tstring = string.replace( /</g, '\\\\<' );\n\n\treturn string;\n}\n\nTurndownService.prototype.escape = function( string: string ): string {\n\t// Urls should not be escaped. Our strategy is using a regex to find them and escape everything\n\t// which is out of the matches parts.\n\n\tlet escaped = '';\n\tlet lastLinkEnd = 0;\n\n\tfor ( const match of matchAutolink( string ) ) {\n\t\tconst index = match.index!;\n\n\t\t// Append the substring between the last match and the current one (if anything).\n\t\tif ( index > lastLinkEnd ) {\n\t\t\tescaped += escape( string.substring( lastLinkEnd, index ) );\n\t\t}\n\n\t\tconst matchedURL = match[ 0 ];\n\n\t\tescaped += matchedURL;\n\n\t\tlastLinkEnd = index + matchedURL.length;\n\t}\n\n\t// Add text after the last link or at the string start if no matches.\n\tif ( lastLinkEnd < string.length ) {\n\t\tescaped += escape( string.substring( lastLinkEnd, string.length ) );\n\t}\n\n\treturn escaped;\n};\n\nconst turndownService = new TurndownService( {\n\tcodeBlockStyle: 'fenced',\n\thr: '---',\n\theadingStyle: 'atx'\n} );\n\nturndownService.use( [\n\tgfm,\n\ttodoList\n] );\n\n/**\n * Parses HTML to a markdown.\n */\nexport default function html2markdown( html: string ): string {\n\treturn turndownService.turndown( html );\n}\n\nexport { turndownService };\n\n// This is a copy of the original taskListItems rule from turdown-plugin-gfm, with minor changes.\nfunction todoList( turndownService: TurndownService ): void {\n\tturndownService.addRule( 'taskListItems', {\n\t\tfilter( node: any ) {\n\t\t\treturn node.type === 'checkbox' &&\n\t\t\t\t// Changes here as CKEditor outputs a deeper structure.\n\t\t\t\t( node.parentNode.nodeName === 'LI' || node.parentNode.parentNode.nodeName === 'LI' );\n\t\t},\n\t\treplacement( content: any, node: any ) {\n\t\t\treturn ( node.checked ? '[x]' : '[ ]' ) + ' ';\n\t\t}\n\t} );\n}\n\n// Autolink matcher.\nconst regex = new RegExp(\n\t// Prefix.\n\t/\\b(?:(?:https?|ftp):\\/\\/|www\\.)/.source +\n\n\t// Domain name.\n\t/(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})/.source +\n\n\t// The rest.\n\t/(?:[^\\s<>]*)/.source,\n\t'gi'\n);\n\n/**\n * Trimming end of link.\n * https://github.github.com/gfm/#autolinks-extension-\n */\nfunction* matchAutolink( string: string ) {\n\tfor ( const match of string.matchAll( regex ) ) {\n\t\tconst matched = match[ 0 ];\n\t\tconst length = autolinkFindEnd( matched );\n\n\t\tyield Object.assign(\n\t\t\t[ matched.substring( 0, length ) ],\n\t\t\t{ index: match.index }\n\t\t);\n\n\t\t// We could adjust regex.lastIndex but it's not needed because what we skipped is for sure not a valid URL.\n\t}\n}\n\n/**\n * Returns the new length of the link (after it would trim trailing characters).\n */\nfunction autolinkFindEnd( string: string ) {\n\tlet length = string.length;\n\n\twhile ( length > 0 ) {\n\t\tconst char = string[ length - 1 ];\n\n\t\tif ( '?!.,:*_~\\'\"'.includes( char ) ) {\n\t\t\tlength--;\n\t\t} else if ( char == ')' ) {\n\t\t\tlet openBrackets = 0;\n\n\t\t\tfor ( let i = 0; i < length; i++ ) {\n\t\t\t\tif ( string[ i ] == '(' ) {\n\t\t\t\t\topenBrackets++;\n\t\t\t\t} else if ( string[ i ] == ')' ) {\n\t\t\t\t\topenBrackets--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If there is fewer opening brackets then closing ones we should remove a closing bracket.\n\t\t\tif ( openBrackets < 0 ) {\n\t\t\t\tlength--;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn length;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module markdown-gfm/gfmdataprocessor\n */\n\nimport {\n\tHtmlDataProcessor,\n\ttype DataProcessor,\n\ttype ViewDocument,\n\ttype ViewDocumentFragment,\n\ttype MatcherPattern\n} from 'ckeditor5/src/engine.js';\n\nimport markdown2html from './markdown2html/markdown2html.js';\nimport html2markdown, { turndownService } from './html2markdown/html2markdown.js';\n\n/**\n * This data processor implementation uses GitHub Flavored Markdown as input/output data.\n *\n * See the {@glink features/markdown Markdown output} guide to learn more on how to enable it.\n */\nexport default class GFMDataProcessor implements DataProcessor {\n\t/**\n\t * HTML data processor used to process HTML produced by the Markdown-to-HTML converter and the other way.\n\t */\n\tprivate _htmlDP: HtmlDataProcessor;\n\n\t/**\n\t * Creates a new instance of the Markdown data processor class.\n\t */\n\tconstructor( document: ViewDocument ) {\n\t\tthis._htmlDP = new HtmlDataProcessor( document );\n\t}\n\n\t/**\n\t * Keeps the specified element in the output as HTML. This is useful if the editor contains\n\t * features producing HTML that is not a part of the Markdown standard.\n\t *\n\t * By default, all HTML tags are removed.\n\t *\n\t * @param element The element name to be kept.\n\t */\n\tpublic keepHtml( element: keyof HTMLElementTagNameMap ): void {\n\t\tturndownService.keep( [ element ] );\n\t}\n\n\t/**\n\t * Converts the provided Markdown string to a view tree.\n\t *\n\t * @param data A Markdown string.\n\t * @returns The converted view element.\n\t */\n\tpublic toView( data: string ): ViewDocumentFragment {\n\t\tconst html = markdown2html( data );\n\t\treturn this._htmlDP.toView( html );\n\t}\n\n\t/**\n\t * Converts the provided {@link module:engine/view/documentfragment~DocumentFragment} to data format – in this\n\t * case to a Markdown string.\n\t *\n\t * @returns Markdown string.\n\t */\n\tpublic toData( viewFragment: ViewDocumentFragment ): string {\n\t\tconst html = this._htmlDP.toData( viewFragment );\n\t\treturn html2markdown( html );\n\t}\n\n\t/**\n\t * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data\n\t * and not processed during the conversion from Markdown to view elements.\n\t *\n\t * The raw data can be later accessed by a\n\t * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `\"$rawContent\"`.\n\t *\n\t * @param pattern The pattern matching all view elements whose content should\n\t * be treated as raw data.\n\t */\n\tpublic registerRawContentMatcher( pattern: MatcherPattern ): void {\n\t\tthis._htmlDP.registerRawContentMatcher( pattern );\n\t}\n\n\t/**\n\t * This method does not have any effect on the data processor result. It exists for compatibility with the\n\t * {@link module:engine/dataprocessor/dataprocessor~DataProcessor `DataProcessor` interface}.\n\t */\n\tpublic useFillerType(): void {}\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module markdown-gfm/markdown\n */\n\nimport { Plugin, type Editor } from 'ckeditor5/src/core.js';\nimport GFMDataProcessor from './gfmdataprocessor.js';\n\n/**\n * The GitHub Flavored Markdown (GFM) plugin.\n *\n * For a detailed overview, check the {@glink features/markdown Markdown feature} guide.\n */\nexport default class Markdown extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor: Editor ) {\n\t\tsuper( editor );\n\n\t\teditor.data.processor = new GFMDataProcessor( editor.data.viewDocument );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'Markdown' as const;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module markdown-gfm/pastefrommarkdownexperimental\n */\n\nimport { Plugin, type Editor } from 'ckeditor5/src/core.js';\nimport { ClipboardPipeline, type ClipboardInputTransformationEvent } from 'ckeditor5/src/clipboard.js';\nimport GFMDataProcessor from './gfmdataprocessor.js';\nimport type { ViewDocumentKeyDownEvent } from 'ckeditor5/src/engine.js';\n\nconst ALLOWED_MARKDOWN_FIRST_LEVEL_TAGS = [ 'SPAN', 'BR', 'PRE', 'CODE' ];\n\n/**\n * The GitHub Flavored Markdown (GFM) paste plugin.\n *\n * For a detailed overview, check the {@glink features/pasting/paste-markdown Paste Markdown feature} guide.\n */\nexport default class PasteFromMarkdownExperimental extends Plugin {\n\t/**\n\t * @internal\n\t */\n\tprivate _gfmDataProcessor: GFMDataProcessor;\n\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor: Editor ) {\n\t\tsuper( editor );\n\n\t\tthis._gfmDataProcessor = new GFMDataProcessor( editor.data.viewDocument );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'PasteFromMarkdownExperimental' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires() {\n\t\treturn [ ClipboardPipeline ] as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\t\tconst view = editor.editing.view;\n\t\tconst viewDocument = view.document;\n\n\t\tconst clipboardPipeline: ClipboardPipeline = editor.plugins.get( 'ClipboardPipeline' );\n\n\t\tlet shiftPressed = false;\n\n\t\tthis.listenTo<ViewDocumentKeyDownEvent>( viewDocument, 'keydown', ( evt, data ) => {\n\t\t\tshiftPressed = data.shiftKey;\n\t\t} );\n\n\t\tthis.listenTo<ClipboardInputTransformationEvent>( clipboardPipeline, 'inputTransformation', ( evt, data ) => {\n\t\t\tif ( shiftPressed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst dataAsTextHtml = data.dataTransfer.getData( 'text/html' );\n\n\t\t\tif ( !dataAsTextHtml ) {\n\t\t\t\tconst dataAsTextPlain = data.dataTransfer.getData( 'text/plain' );\n\n\t\t\t\tdata.content = this._gfmDataProcessor.toView( dataAsTextPlain );\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst markdownFromHtml = this._parseMarkdownFromHtml( dataAsTextHtml );\n\n\t\t\tif ( markdownFromHtml ) {\n\t\t\t\tdata.content = this._gfmDataProcessor.toView( markdownFromHtml );\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Determines if the code copied from a website in the `text/html` type can be parsed as Markdown.\n\t * It removes any OS-specific HTML tags, for example, <meta> on macOS and <!--StartFragment--> on Windows.\n\t * Then removes a single wrapper HTML tag or wrappers for sibling tags, and if there are no more tags left,\n\t * returns the remaining text. Returns null if there are any remaining HTML tags detected.\n\t *\n\t * @param htmlString Clipboard content in the `text/html` type format.\n\t */\n\tprivate _parseMarkdownFromHtml( htmlString: string ): string | null {\n\t\tconst withoutOsSpecificTags = this._removeOsSpecificTags( htmlString );\n\n\t\tif ( !this._containsOnlyAllowedFirstLevelTags( withoutOsSpecificTags ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst withoutWrapperTag = this._removeFirstLevelWrapperTagsAndBrs( withoutOsSpecificTags );\n\n\t\tif ( this._containsAnyRemainingHtmlTags( withoutWrapperTag ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._replaceHtmlReservedEntitiesWithCharacters( withoutWrapperTag );\n\t}\n\n\t/**\n\t * Removes OS-specific tags.\n\t *\n\t * @param htmlString Clipboard content in the `text/html` type format.\n\t */\n\tprivate _removeOsSpecificTags( htmlString: string ): string {\n\t\t// Removing the <meta> tag present on Mac.\n\t\tconst withoutMetaTag = htmlString.replace( /^<meta\\b[^>]*>/, '' ).trim();\n\t\t// Removing the <html> tag present on Windows.\n\t\tconst withoutHtmlTag = withoutMetaTag.replace( /^<html>/, '' ).replace( /<\\/html>$/, '' ).trim();\n\t\t// Removing the <body> tag present on Windows.\n\t\tconst withoutBodyTag = withoutHtmlTag.replace( /^<body>/, '' ).replace( /<\\/body>$/, '' ).trim();\n\n\t\t// Removing the <!--StartFragment--> tag present on Windows.\n\t\treturn withoutBodyTag.replace( /^<!--StartFragment-->/, '' ).replace( /<!--EndFragment-->$/, '' ).trim();\n\t}\n\n\t/**\n\t * If the input HTML string contains any first-level formatting tags\n\t * like <b>, <strong>, or <i>, we should not treat it as Markdown.\n\t *\n\t * @param htmlString Clipboard content.\n\t */\n\tprivate _containsOnlyAllowedFirstLevelTags( htmlString: string ): boolean {\n\t\tconst parser = new DOMParser();\n\t\tconst { body: tempElement } = parser.parseFromString( htmlString, 'text/html' );\n\n\t\tconst tagNames = Array.from( tempElement.children ).map( el => el.tagName );\n\n\t\treturn tagNames.every( el => ALLOWED_MARKDOWN_FIRST_LEVEL_TAGS.includes( el ) );\n\t}\n\n\t/**\n\t * Removes multiple HTML wrapper tags from a list of sibling HTML tags.\n\t *\n\t * @param htmlString Clipboard content without any OS-specific tags.\n\t */\n\tprivate _removeFirstLevelWrapperTagsAndBrs( htmlString: string ): string {\n\t\tconst parser = new DOMParser();\n\t\tconst { body: tempElement } = parser.parseFromString( htmlString, 'text/html' );\n\n\t\tconst brElements = tempElement.querySelectorAll( 'br' );\n\n\t\tfor ( const br of brElements ) {\n\t\t\tbr.replaceWith( '\\n' );\n\t\t}\n\n\t\tconst outerElements = tempElement.querySelectorAll( ':scope > *' );\n\n\t\tfor ( const element of outerElements ) {\n\t\t\tconst elementClone = element.cloneNode( true );\n\t\t\telement.replaceWith( ...elementClone.childNodes );\n\t\t}\n\n\t\treturn tempElement.innerHTML;\n\t}\n\n\t/**\n\t * Determines if a string contains any HTML tags.\n\t */\n\tprivate _containsAnyRemainingHtmlTags( str: string ): boolean {\n\t\treturn str.includes( '<' );\n\t}\n\n\t/**\n\t * Replaces the reserved HTML entities with the actual characters.\n\t *\n\t * @param htmlString Clipboard content without any tags.\n\t */\n\tprivate _replaceHtmlReservedEntitiesWithCharacters( htmlString: string ) {\n\t\treturn htmlString\n\t\t\t.replace( />/g, '>' )\n\t\t\t.replace( /</g, '<' )\n\t\t\t.replace( / /g, ' ' );\n\t}\n}\n"]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
+
*/
|
9
|
+
import type { Markdown, PasteFromMarkdownExperimental } from './index.js';
|
10
|
+
declare module '@ckeditor/ckeditor5-core' {
|
11
|
+
interface PluginsMap {
|
12
|
+
[Markdown.pluginName]: Markdown;
|
13
|
+
[PasteFromMarkdownExperimental.pluginName]: PasteFromMarkdownExperimental;
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* @module markdown-gfm/gfmdataprocessor
|
11
|
+
*/
|
12
|
+
import { type DataProcessor, type ViewDocument, type ViewDocumentFragment, type MatcherPattern } from 'ckeditor5/src/engine.js';
|
13
|
+
/**
|
14
|
+
* This data processor implementation uses GitHub Flavored Markdown as input/output data.
|
15
|
+
*
|
16
|
+
* See the {@glink features/markdown Markdown output} guide to learn more on how to enable it.
|
17
|
+
*/
|
18
|
+
export default class GFMDataProcessor implements DataProcessor {
|
19
|
+
/**
|
20
|
+
* HTML data processor used to process HTML produced by the Markdown-to-HTML converter and the other way.
|
21
|
+
*/
|
22
|
+
private _htmlDP;
|
23
|
+
/**
|
24
|
+
* Creates a new instance of the Markdown data processor class.
|
25
|
+
*/
|
26
|
+
constructor(document: ViewDocument);
|
27
|
+
/**
|
28
|
+
* Keeps the specified element in the output as HTML. This is useful if the editor contains
|
29
|
+
* features producing HTML that is not a part of the Markdown standard.
|
30
|
+
*
|
31
|
+
* By default, all HTML tags are removed.
|
32
|
+
*
|
33
|
+
* @param element The element name to be kept.
|
34
|
+
*/
|
35
|
+
keepHtml(element: keyof HTMLElementTagNameMap): void;
|
36
|
+
/**
|
37
|
+
* Converts the provided Markdown string to a view tree.
|
38
|
+
*
|
39
|
+
* @param data A Markdown string.
|
40
|
+
* @returns The converted view element.
|
41
|
+
*/
|
42
|
+
toView(data: string): ViewDocumentFragment;
|
43
|
+
/**
|
44
|
+
* Converts the provided {@link module:engine/view/documentfragment~DocumentFragment} to data format – in this
|
45
|
+
* case to a Markdown string.
|
46
|
+
*
|
47
|
+
* @returns Markdown string.
|
48
|
+
*/
|
49
|
+
toData(viewFragment: ViewDocumentFragment): string;
|
50
|
+
/**
|
51
|
+
* Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
|
52
|
+
* and not processed during the conversion from Markdown to view elements.
|
53
|
+
*
|
54
|
+
* The raw data can be later accessed by a
|
55
|
+
* {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
|
56
|
+
*
|
57
|
+
* @param pattern The pattern matching all view elements whose content should
|
58
|
+
* be treated as raw data.
|
59
|
+
*/
|
60
|
+
registerRawContentMatcher(pattern: MatcherPattern): void;
|
61
|
+
/**
|
62
|
+
* This method does not have any effect on the data processor result. It exists for compatibility with the
|
63
|
+
* {@link module:engine/dataprocessor/dataprocessor~DataProcessor `DataProcessor` interface}.
|
64
|
+
*/
|
65
|
+
useFillerType(): void;
|
66
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
+
*/
|
9
|
+
declare const turndownService: any;
|
10
|
+
/**
|
11
|
+
* Parses HTML to a markdown.
|
12
|
+
*/
|
13
|
+
export default function html2markdown(html: string): string;
|
14
|
+
export { turndownService };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* @module markdown-gfm
|
11
|
+
*/
|
12
|
+
export { default as Markdown } from './markdown.js';
|
13
|
+
export { default as PasteFromMarkdownExperimental } from './pastefrommarkdownexperimental.js';
|
14
|
+
import './augmentation.js';
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* @module markdown-gfm/markdown
|
11
|
+
*/
|
12
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
13
|
+
/**
|
14
|
+
* The GitHub Flavored Markdown (GFM) plugin.
|
15
|
+
*
|
16
|
+
* For a detailed overview, check the {@glink features/markdown Markdown feature} guide.
|
17
|
+
*/
|
18
|
+
export default class Markdown extends Plugin {
|
19
|
+
/**
|
20
|
+
* @inheritDoc
|
21
|
+
*/
|
22
|
+
constructor(editor: Editor);
|
23
|
+
/**
|
24
|
+
* @inheritDoc
|
25
|
+
*/
|
26
|
+
static get pluginName(): "Markdown";
|
27
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* @module markdown-gfm/markdown2html/markdown2html
|
11
|
+
*/
|
12
|
+
import { marked } from 'marked';
|
13
|
+
/**
|
14
|
+
* Parses markdown string to an HTML.
|
15
|
+
*/
|
16
|
+
export default function markdown2html(markdown: string): string;
|
17
|
+
export { marked };
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* @module markdown-gfm/pastefrommarkdownexperimental
|
11
|
+
*/
|
12
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
13
|
+
import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
|
14
|
+
/**
|
15
|
+
* The GitHub Flavored Markdown (GFM) paste plugin.
|
16
|
+
*
|
17
|
+
* For a detailed overview, check the {@glink features/pasting/paste-markdown Paste Markdown feature} guide.
|
18
|
+
*/
|
19
|
+
export default class PasteFromMarkdownExperimental extends Plugin {
|
20
|
+
/**
|
21
|
+
* @internal
|
22
|
+
*/
|
23
|
+
private _gfmDataProcessor;
|
24
|
+
/**
|
25
|
+
* @inheritDoc
|
26
|
+
*/
|
27
|
+
constructor(editor: Editor);
|
28
|
+
/**
|
29
|
+
* @inheritDoc
|
30
|
+
*/
|
31
|
+
static get pluginName(): "PasteFromMarkdownExperimental";
|
32
|
+
/**
|
33
|
+
* @inheritDoc
|
34
|
+
*/
|
35
|
+
static get requires(): readonly [typeof ClipboardPipeline];
|
36
|
+
/**
|
37
|
+
* @inheritDoc
|
38
|
+
*/
|
39
|
+
init(): void;
|
40
|
+
/**
|
41
|
+
* Determines if the code copied from a website in the `text/html` type can be parsed as Markdown.
|
42
|
+
* It removes any OS-specific HTML tags, for example, <meta> on macOS and <!--StartFragment--> on Windows.
|
43
|
+
* Then removes a single wrapper HTML tag or wrappers for sibling tags, and if there are no more tags left,
|
44
|
+
* returns the remaining text. Returns null if there are any remaining HTML tags detected.
|
45
|
+
*
|
46
|
+
* @param htmlString Clipboard content in the `text/html` type format.
|
47
|
+
*/
|
48
|
+
private _parseMarkdownFromHtml;
|
49
|
+
/**
|
50
|
+
* Removes OS-specific tags.
|
51
|
+
*
|
52
|
+
* @param htmlString Clipboard content in the `text/html` type format.
|
53
|
+
*/
|
54
|
+
private _removeOsSpecificTags;
|
55
|
+
/**
|
56
|
+
* If the input HTML string contains any first-level formatting tags
|
57
|
+
* like <b>, <strong>, or <i>, we should not treat it as Markdown.
|
58
|
+
*
|
59
|
+
* @param htmlString Clipboard content.
|
60
|
+
*/
|
61
|
+
private _containsOnlyAllowedFirstLevelTags;
|
62
|
+
/**
|
63
|
+
* Removes multiple HTML wrapper tags from a list of sibling HTML tags.
|
64
|
+
*
|
65
|
+
* @param htmlString Clipboard content without any OS-specific tags.
|
66
|
+
*/
|
67
|
+
private _removeFirstLevelWrapperTagsAndBrs;
|
68
|
+
/**
|
69
|
+
* Determines if a string contains any HTML tags.
|
70
|
+
*/
|
71
|
+
private _containsAnyRemainingHtmlTags;
|
72
|
+
/**
|
73
|
+
* Replaces the reserved HTML entities with the actual characters.
|
74
|
+
*
|
75
|
+
* @param htmlString Clipboard content without any tags.
|
76
|
+
*/
|
77
|
+
private _replaceHtmlReservedEntitiesWithCharacters;
|
78
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-markdown-gfm",
|
3
|
-
"version": "41.
|
3
|
+
"version": "41.4.0-alpha.0",
|
4
4
|
"description": "GitHub Flavored Markdown data processor for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
"type": "module",
|
14
14
|
"main": "src/index.js",
|
15
15
|
"dependencies": {
|
16
|
-
"ckeditor5": "41.
|
16
|
+
"ckeditor5": "41.4.0-alpha.0",
|
17
17
|
"marked": "4.0.12",
|
18
18
|
"turndown": "6.0.0",
|
19
19
|
"turndown-plugin-gfm": "1.0.2"
|
@@ -28,6 +28,7 @@
|
|
28
28
|
"directory": "packages/ckeditor5-markdown-gfm"
|
29
29
|
},
|
30
30
|
"files": [
|
31
|
+
"dist",
|
31
32
|
"lang",
|
32
33
|
"src/**/*.js",
|
33
34
|
"src/**/*.d.ts",
|
@@ -8,7 +8,7 @@
|
|
8
8
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
9
9
|
// Importing types for this package is problematic, so it's omitted.
|
10
10
|
// @ts-ignore
|
11
|
-
import TurndownService from 'turndown';
|
11
|
+
import TurndownService from 'turndown/lib/turndown.browser.es.js';
|
12
12
|
// There no avaialble types for 'turndown-plugin-gfm' module and it's not worth to generate them on our own.
|
13
13
|
// @ts-ignore
|
14
14
|
import { gfm } from 'turndown-plugin-gfm';
|