nadesiko3 3.7.2 → 3.7.4
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/batch/command.txt +472 -469
- package/batch/pickup_command.nako3 +1 -1
- package/core/.eslintrc.cjs +10 -3
- package/core/package-lock.json +1184 -645
- package/core/package.json +4 -5
- package/core/src/nako3.mjs +8 -6
- package/core/src/nako3.mts +19 -16
- package/core/src/nako_ast.mts +2 -3
- package/core/src/nako_core_version.mjs +2 -2
- package/core/src/nako_core_version.mts +2 -2
- package/core/src/nako_csv.mjs +1 -0
- package/core/src/nako_csv.mts +3 -2
- package/core/src/nako_from_dncl.mjs +1 -1
- package/core/src/nako_from_dncl.mts +1 -1
- package/core/src/nako_from_dncl2.mjs +1 -1
- package/core/src/nako_from_dncl2.mts +2 -2
- package/core/src/nako_gen.mjs +37 -35
- package/core/src/nako_gen.mts +70 -67
- package/core/src/nako_global.mjs +3 -2
- package/core/src/nako_global.mts +3 -2
- package/core/src/nako_lexer.mjs +3 -3
- package/core/src/nako_lexer.mts +3 -3
- package/core/src/nako_logger.mjs +1 -1
- package/core/src/nako_logger.mts +2 -2
- package/core/src/nako_parser3.mjs +67 -59
- package/core/src/nako_parser3.mts +96 -90
- package/core/src/nako_parser_base.mts +3 -3
- package/core/src/nako_prepare.mjs +1 -1
- package/core/src/nako_prepare.mts +1 -1
- package/core/src/nako_source_mapping.mts +0 -1
- package/core/src/nako_token.mts +8 -8
- package/core/src/nako_types.mts +1 -1
- package/core/src/plugin_api.mts +1 -1
- package/core/src/plugin_csv.mjs +1 -0
- package/core/src/plugin_csv.mts +2 -1
- package/core/src/plugin_math.mjs +2 -2
- package/core/src/plugin_math.mts +3 -3
- package/core/src/plugin_promise.mjs +1 -1
- package/core/src/plugin_promise.mts +1 -1
- package/core/src/plugin_system.mjs +117 -40
- package/core/src/plugin_system.mts +132 -58
- package/core/src/plugin_test.mjs +3 -1
- package/core/src/plugin_test.mts +3 -1
- package/core/test/basic_test.mjs +16 -0
- package/core/test/calc_test.mjs +7 -0
- package/core/test/plugin_system_test.mjs +33 -0
- package/doc/files.md +4 -4
- package/doc/plugins.md +1 -1
- package/package.json +9 -9
- package/release/_hash.txt +36 -121
- package/release/_script-tags.txt +16 -33
- package/release/command.json +1 -1
- package/release/command.json.js +1 -1
- package/release/command_cnako3.json +1 -1
- package/release/command_list.json +1 -1
- package/release/edit_main.js +3 -3
- package/release/edit_main.js.map +2 -2
- package/release/editor.js +3 -3
- package/release/plugin_markup.js +53 -53
- package/release/plugin_markup.js.map +3 -3
- package/release/plugin_weykturtle3d.js +1 -1
- package/release/plugin_weykturtle3d.js.map +4 -4
- package/release/version.js +3 -3
- package/release/version_main.js +3 -3
- package/release/version_main.js.map +2 -2
- package/release/wnako3.js +66 -66
- package/release/wnako3.js.map +3 -3
- package/release/wnako3webworker.js +58 -58
- package/release/wnako3webworker.js.map +3 -3
- package/src/browsers.txt +30 -20
- package/src/cnako3mod.mjs +19 -18
- package/src/cnako3mod.mts +17 -16
- package/src/deno_wrapper.mjs +6 -6
- package/src/deno_wrapper.mts +11 -11
- package/src/nako_version.mjs +2 -2
- package/src/nako_version.mts +2 -2
- package/src/plugin_browser.mjs +2 -2
- package/src/plugin_browser.mts +5 -5
- package/src/plugin_browser_ajax.mjs +2 -2
- package/src/plugin_browser_ajax.mts +2 -2
- package/src/plugin_browser_api.mts +0 -1
- package/src/plugin_browser_crypto.mjs +8 -8
- package/src/plugin_browser_crypto.mts +13 -13
- package/src/plugin_browser_dom_basic.mjs +3 -3
- package/src/plugin_browser_dom_basic.mts +5 -7
- package/src/plugin_browser_dom_event.mjs +1 -1
- package/src/plugin_browser_dom_event.mts +2 -1
- package/src/plugin_browser_dom_parts.mjs +33 -18
- package/src/plugin_browser_dom_parts.mts +60 -59
- package/src/plugin_browser_speech.mjs +1 -1
- package/src/plugin_browser_speech.mts +1 -1
- package/src/plugin_node.mjs +5 -3
- package/src/plugin_node.mts +6 -4
- package/src/plugin_weykturtle3d.mjs +38 -15
- package/src/plugin_weykturtle3d.mts +279 -240
- package/src/plugin_weykturtle3d_three.mjs +3 -0
- package/src/plugin_weykturtle3d_three.mts +214 -0
- package/src/plugin_weykturtle3d_threeutil.mjs +28 -0
- package/src/plugin_weykturtle3d_threeutil.mts +31 -0
- package/src/wnako3.mjs +1 -0
- package/src/wnako3.mts +1 -0
- package/src/wnako3mod.mjs +5 -2
- package/src/wnako3mod.mts +6 -3
- package/batch/command_nakopad.txt +0 -1177
- package/core/__report.txt +0 -617
- package/core/command/plugin_snako.mjs +0 -112
- package/core/command/snako.mjs +0 -108
- package/release/core_src_nako_josi_list_mjs.js +0 -3
- package/release/core_src_nako_josi_list_mjs.js.LICENSE.txt +0 -3
- package/release/core_src_nako_josi_list_mjs.js.map +0 -1
- package/release/core_src_nako_reserved_words_mjs.js +0 -3
- package/release/core_src_nako_reserved_words_mjs.js.LICENSE.txt +0 -3
- package/release/core_src_nako_reserved_words_mjs.js.map +0 -1
- package/release/editor/edit_main.js +0 -48
- package/release/editor/edit_main.js.map +0 -7
- package/release/editor/version_main.js +0 -44
- package/release/editor/version_main.js.map +0 -7
- package/release/editor.js.LICENSE.txt +0 -91
- package/release/editor.js.map +0 -1
- package/release/nako_gen_async.js +0 -2
- package/release/nako_gen_async.js.LICENSE.txt +0 -21
- package/release/nako_gen_async.js.map +0 -1
- package/release/plugin_caniuse.js.LICENSE.txt +0 -15
- package/release/plugin_datetime.js.LICENSE.txt +0 -21
- package/release/plugin_kansuji.js.LICENSE.txt +0 -3
- package/release/plugin_markup.js.LICENSE.txt +0 -15
- package/release/plugin_toml.js +0 -295
- package/release/plugin_toml.js.map +0 -7
- package/release/plugin_turtle.js.LICENSE.txt +0 -9
- package/release/plugin_webworker.js.LICENSE.txt +0 -3
- package/release/plugin_weykturtle3d.js.LICENSE.txt +0 -3
- package/release/src/plugin_caniuse.js +0 -2
- package/release/src/plugin_caniuse.js.map +0 -7
- package/release/src/plugin_datetime.js +0 -2
- package/release/src/plugin_datetime.js.map +0 -7
- package/release/src/plugin_kansuji.js +0 -2
- package/release/src/plugin_kansuji.js.map +0 -7
- package/release/src/plugin_keigo.js +0 -2
- package/release/src/plugin_keigo.js.map +0 -7
- package/release/src/plugin_markup.js +0 -64
- package/release/src/plugin_markup.js.map +0 -7
- package/release/src/plugin_three.js +0 -2
- package/release/src/plugin_three.js.map +0 -7
- package/release/src/plugin_turtle.js +0 -2
- package/release/src/plugin_turtle.js.map +0 -7
- package/release/src/plugin_webworker.js +0 -4
- package/release/src/plugin_webworker.js.map +0 -7
- package/release/src/plugin_weykturtle3d.js +0 -2
- package/release/src/plugin_weykturtle3d.js.map +0 -7
- package/release/src/wnako3.js +0 -482
- package/release/src/wnako3.js.map +0 -7
- package/release/src/wnako3webworker.js +0 -428
- package/release/src/wnako3webworker.js.map +0 -7
- package/release/stats.json +0 -1
- package/release/version.js.LICENSE.txt +0 -65
- package/release/version.js.map +0 -1
- package/release/wnako3.js.LICENSE.txt +0 -341
- package/release/wnako3webworker.js.LICENSE.txt +0 -209
- package/src/plugin_three.mts +0 -240
package/release/plugin_markup.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
\r `.split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(
|
|
3
|
-
`);for(var
|
|
4
|
-
`||
|
|
5
|
-
`,this.line_char_count=0;continue}}
|
|
6
|
-
`);for(var
|
|
7
|
-
`);var
|
|
8
|
-
`+
|
|
9
|
-
]`).replace("lheading",
|
|
10
|
-
`).map(
|
|
11
|
-
`)}var B=class{options;rules;lexer;constructor(
|
|
12
|
-
`)}}}fences(
|
|
13
|
-
`)}}blockquote(
|
|
1
|
+
"use strict";(()=>{var Ae=Object.create;var re=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty;var Ee=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var Ie=(a,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ze(e))!Le.call(a,s)&&s!==t&&re(a,s,{get:()=>e[s],enumerable:!(n=ve(e,s))||n.enumerable});return a};var Pe=(a,e,t)=>(t=a!=null?Ae(Ce(a)):{},Ie(e||!a||!a.__esModule?re(t,"default",{value:a,enumerable:!0}):t,a));var Se=Ee(($t,Te)=>{function kt(a,e){var t,n,s,r,i,l;e=e||{},n=e.indent_size||4,s=e.indent_char||" ",i=e.brace_style||"collapse",r=e.max_char==0?1/0:e.max_char||70,l=e.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"];function o(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.Utils={whitespace:`
|
|
2
|
+
\r `.split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(c,u){for(var x=0;x<u.length;x++)if(c===u[x])return!0;return!1}},this.get_content=function(){for(var c="",u=[],x=!1;this.input.charAt(this.pos)!=="<";){if(this.pos>=this.input.length)return u.length?u.join(""):["","TK_EOF"];if(c=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(c,this.Utils.whitespace)){u.length&&(x=!0),this.line_char_count--;continue}else if(x){if(this.line_char_count>=this.max_char){u.push(`
|
|
3
|
+
`);for(var w=0;w<this.indent_level;w++)u.push(this.indent_string);this.line_char_count=0}else u.push(" "),this.line_char_count++;x=!1}u.push(c)}return u.length?u.join(""):""},this.get_contents_to=function(c){if(this.pos==this.input.length)return["","TK_EOF"];var u="",x="",w=new RegExp("</"+c+"\\s*>","igm");w.lastIndex=this.pos;var S=w.exec(this.input),T=S?S.index:this.input.length;return this.pos<T&&(x=this.input.substring(this.pos,T),this.pos=T),x},this.record_tag=function(c){this.tags[c+"count"]?(this.tags[c+"count"]++,this.tags[c+this.tags[c+"count"]]=this.indent_level):(this.tags[c+"count"]=1,this.tags[c+this.tags[c+"count"]]=this.indent_level),this.tags[c+this.tags[c+"count"]+"parent"]=this.tags.parent,this.tags.parent=c+this.tags[c+"count"]},this.retrieve_tag=function(c){if(this.tags[c+"count"]){for(var u=this.tags.parent;u&&c+this.tags[c+"count"]!==u;)u=this.tags[u+"parent"];u&&(this.indent_level=this.tags[c+this.tags[c+"count"]],this.tags.parent=this.tags[u+"parent"]),delete this.tags[c+this.tags[c+"count"]+"parent"],delete this.tags[c+this.tags[c+"count"]],this.tags[c+"count"]==1?delete this.tags[c+"count"]:this.tags[c+"count"]--}},this.get_tag=function(){var c="",u=[],x=!1,w,S;do{if(this.pos>=this.input.length)return u.length?u.join(""):["","TK_EOF"];if(c=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(c,this.Utils.whitespace)){x=!0,this.line_char_count--;continue}(c==="'"||c==='"')&&(!u[1]||u[1]!=="!")&&(c+=this.get_unformatted(c),x=!0),c==="="&&(x=!1),u.length&&u[u.length-1]!=="="&&c!==">"&&x&&(this.line_char_count>=this.max_char?(this.print_newline(!1,u),this.line_char_count=0):(u.push(" "),this.line_char_count++),x=!1),c==="<"&&(w=this.pos-1),u.push(c)}while(c!==">");var T=u.join(""),L;T.indexOf(" ")!=-1?L=T.indexOf(" "):L=T.indexOf(">");var _=T.substring(1,L).toLowerCase();if(T.charAt(T.length-2)==="/"||this.Utils.in_array(_,this.Utils.single_token))this.tag_type="SINGLE";else if(_==="script")this.record_tag(_),this.tag_type="SCRIPT";else if(_==="style")this.record_tag(_),this.tag_type="STYLE";else if(this.Utils.in_array(_,l)){var z=this.get_unformatted("</"+_+">",T);u.push(z),w>0&&this.Utils.in_array(this.input.charAt(w-1),this.Utils.whitespace)&&u.splice(0,0,this.input.charAt(w-1)),S=this.pos-1,this.Utils.in_array(this.input.charAt(S+1),this.Utils.whitespace)&&u.push(this.input.charAt(S+1)),this.tag_type="SINGLE"}else if(_.charAt(0)==="!")if(_.indexOf("[if")!=-1){if(T.indexOf("!IE")!=-1){var z=this.get_unformatted("-->",T);u.push(z)}this.tag_type="START"}else if(_.indexOf("[endif")!=-1)this.tag_type="END",this.unindent();else if(_.indexOf("[cdata[")!=-1){var z=this.get_unformatted("]]>",T);u.push(z),this.tag_type="SINGLE"}else{var z=this.get_unformatted("-->",T);u.push(z),this.tag_type="SINGLE"}else _.charAt(0)==="/"?(this.retrieve_tag(_.substring(1)),this.tag_type="END"):(this.record_tag(_),this.tag_type="START"),this.Utils.in_array(_,this.Utils.extra_liners)&&this.print_newline(!0,this.output);return u.join("")},this.get_unformatted=function(c,u){if(u&&u.toLowerCase().indexOf(c)!=-1)return"";var x="",w="",S=!0;do{if(this.pos>=this.input.length)return w;if(x=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(x,this.Utils.whitespace)){if(!S){this.line_char_count--;continue}if(x===`
|
|
4
|
+
`||x==="\r"){w+=`
|
|
5
|
+
`,this.line_char_count=0;continue}}w+=x,this.line_char_count++,S=!0}while(w.toLowerCase().indexOf(c)==-1);return w},this.get_token=function(){var c;if(this.last_token==="TK_TAG_SCRIPT"||this.last_token==="TK_TAG_STYLE"){var u=this.last_token.substr(7);return c=this.get_contents_to(u),typeof c!="string"?c:[c,"TK_"+u]}if(this.current_mode==="CONTENT")return c=this.get_content(),typeof c!="string"?c:[c,"TK_CONTENT"];if(this.current_mode==="TAG"){if(c=this.get_tag(),typeof c!="string")return c;var x="TK_TAG_"+this.tag_type;return[c,x]}},this.get_full_indent=function(c){return c=this.indent_level+c||0,c<1?"":Array(c+1).join(this.indent_string)},this.printer=function(c,u,x,w,S){this.input=c||"",this.output=[],this.indent_character=u,this.indent_string="",this.indent_size=x,this.brace_style=S,this.indent_level=0,this.max_char=w,this.line_char_count=0;for(var T=0;T<this.indent_size;T++)this.indent_string+=this.indent_character;this.print_newline=function(L,_){if(this.line_char_count=0,!(!_||!_.length)){if(!L)for(;this.Utils.in_array(_[_.length-1],this.Utils.whitespace);)_.pop();_.push(`
|
|
6
|
+
`);for(var z=0;z<this.indent_level;z++)_.push(this.indent_string)}},this.print_token=function(L){this.output.push(L)},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}for(t=new o,t.printer(a,s,n,r,i);;){var h=t.get_token();if(t.token_text=h[0],t.token_type=h[1],t.token_type==="TK_EOF")break;switch(t.token_type){case"TK_TAG_START":t.print_newline(!1,t.output),t.print_token(t.token_text),t.indent(),t.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":t.print_newline(!1,t.output),t.print_token(t.token_text),t.current_mode="CONTENT";break;case"TK_TAG_END":if(t.last_token==="TK_CONTENT"&&t.last_text===""){var p=t.token_text.match(/\w+/)[0],f=t.output[t.output.length-1].match(/<\s*(\w+)/);(f===null||f[1]!==p)&&t.print_newline(!0,t.output)}t.print_token(t.token_text),t.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var m=t.token_text.match(/^\s*<([a-z]+)/i);(!m||!t.Utils.in_array(m[1],l))&&t.print_newline(!1,t.output),t.print_token(t.token_text),t.current_mode="CONTENT";break;case"TK_CONTENT":t.token_text!==""&&t.print_token(t.token_text),t.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(t.token_text!==""){t.output.push(`
|
|
7
|
+
`);var g=t.token_text;if(t.token_type=="TK_SCRIPT")var y=typeof js_beautify=="function"&&js_beautify;else if(t.token_type=="TK_STYLE")var y=typeof css_beautify=="function"&&css_beautify;if(e.indent_scripts=="keep")var k=0;else if(e.indent_scripts=="separate")var k=-t.indent_level;else var k=1;var R=t.get_full_indent(k);if(y)g=y(g.replace(/^\s*/,R),e);else{var U=g.match(/^\s*/)[0],O=U.match(/[^\n\r]*$/)[0].split(t.indent_string).length-1,M=t.get_full_indent(k-O);g=g.replace(/^\s*/,R).replace(/\r\n|\r|\n/g,`
|
|
8
|
+
`+M).replace(/\s*$/,"")}g&&(t.print_token(g),t.print_newline(!0,t.output))}t.current_mode="TAG";break}t.last_token=t.token_type,t.last_text=t.token_text}return t.output.join("")}Te.exports={prettyPrint:kt}});function W(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var I=W();function pe(a){I=a}var j={exec:()=>null};function d(a,e=""){let t=typeof a=="string"?a:a.source,n={replace:(s,r)=>{let i=typeof r=="string"?r:r.source;return i=i.replace($.caret,"$1"),t=t.replace(s,i),n},getRegex:()=>new RegExp(t,e)};return n}var $={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:a=>new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}#`),htmlBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}<(?:[a-z].*>|!--)`,"i")},Be=/^(?:[ \t]*(?:\n|$))+/,Ne=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Oe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Z=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,V=/(?:[*+-]|\d{1,9}[.)])/,ue=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fe=d(ue).replace(/bull/g,V).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ge=d(ue).replace(/bull/g,V).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),J=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,je=/^[^\n]+/,ee=/(?!\s*\])(?:\\.|[^\[\]\\])+/,De=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ee).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ze=d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,V).getRegex(),Q="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",te=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ue=d("^ {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|$))","i").replace("comment",te).replace("tag",Q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge=d(J).replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",Q).getRegex(),Me=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ge).getRegex(),ne={blockquote:Me,code:Ne,def:De,fences:Oe,heading:qe,hr:Z,html:Ue,lheading:fe,list:Ze,newline:Be,paragraph:ge,table:j,text:je},le=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",Q).getRegex(),Ke={...ne,lheading:Ge,table:le,paragraph:d(J).replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",le).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",Q).getRegex()},He={...ne,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",te).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:j,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(J).replace("hr",Z).replace("heading",` *#{1,6} *[^
|
|
9
|
+
]`).replace("lheading",fe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Qe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Fe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,de=/^( {2,}|\\)\n(?!\s*$)/,Ye=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,F=/[\p{P}\p{S}]/u,se=/[\s\p{P}\p{S}]/u,ke=/[^\s\p{P}\p{S}]/u,Xe=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,se).getRegex(),be=/(?!~)[\p{P}\p{S}]/u,We=/(?!~)[\s\p{P}\p{S}]/u,Ve=/(?:[^\s\p{P}\p{S}]|~)/u,Je=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,xe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,et=d(xe,"u").replace(/punct/g,F).getRegex(),tt=d(xe,"u").replace(/punct/g,be).getRegex(),me="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nt=d(me,"gu").replace(/notPunctSpace/g,ke).replace(/punctSpace/g,se).replace(/punct/g,F).getRegex(),st=d(me,"gu").replace(/notPunctSpace/g,Ve).replace(/punctSpace/g,We).replace(/punct/g,be).getRegex(),it=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ke).replace(/punctSpace/g,se).replace(/punct/g,F).getRegex(),rt=d(/\\(punct)/,"gu").replace(/punct/g,F).getRegex(),lt=d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),at=d(te).replace("(?:-->|$)","-->").getRegex(),ot=d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",at).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),H=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ct=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",H).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_e=d(/^!?\[(label)\]\[(ref)\]/).replace("label",H).replace("ref",ee).getRegex(),we=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",ee).getRegex(),ht=d("reflink|nolink(?!\\()","g").replace("reflink",_e).replace("nolink",we).getRegex(),ie={_backpedal:j,anyPunctuation:rt,autolink:lt,blockSkip:Je,br:de,code:Fe,del:j,emStrongLDelim:et,emStrongRDelimAst:nt,emStrongRDelimUnd:it,escape:Qe,link:ct,nolink:we,punctuation:Xe,reflink:_e,reflinkSearch:ht,tag:ot,text:Ye,url:j},pt={...ie,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",H).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H).getRegex()},Y={...ie,emStrongRDelimAst:st,emStrongLDelim:tt,url:d(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ut={...Y,br:d(de).replace("{2,}","*").getRegex(),text:d(Y.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},K={normal:ne,gfm:Ke,pedantic:He},q={normal:ie,gfm:Y,breaks:ut,pedantic:pt},ft={"&":"&","<":"<",">":">",'"':""","'":"'"},ae=a=>ft[a];function C(a,e){if(e){if($.escapeTest.test(a))return a.replace($.escapeReplace,ae)}else if($.escapeTestNoEncode.test(a))return a.replace($.escapeReplaceNoEncode,ae);return a}function oe(a){try{a=encodeURI(a).replace($.percentDecode,"%")}catch{return null}return a}function ce(a,e){let t=a.replace($.findPipe,(r,i,l)=>{let o=!1,h=i;for(;--h>=0&&l[h]==="\\";)o=!o;return o?"|":" |"}),n=t.split($.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace($.slashPipe,"|");return n}function G(a,e,t){let n=a.length;if(n===0)return"";let s=0;for(;s<n&&a.charAt(n-s-1)===e;)s++;return a.slice(0,n-s)}function gt(a,e){if(a.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<a.length;n++)if(a[n]==="\\")n++;else if(a[n]===e[0])t++;else if(a[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function he(a,e,t,n,s){let r=e.href,i=e.title||null,l=a[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let o={type:a[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:i,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,o}function dt(a,e,t){let n=a.match(t.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
|
|
10
|
+
`).map(r=>{let i=r.match(t.other.beginningSpace);if(i===null)return r;let[l]=i;return l.length>=s.length?r.slice(s.length):r}).join(`
|
|
11
|
+
`)}var B=class{options;rules;lexer;constructor(e){this.options=e||I}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:G(n,`
|
|
12
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],s=dt(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let s=G(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:G(t[0],`
|
|
13
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=G(t[0],`
|
|
14
14
|
`).split(`
|
|
15
|
-
`),s="",
|
|
16
|
-
`),f=
|
|
15
|
+
`),s="",r="",i=[];for(;n.length>0;){let l=!1,o=[],h;for(h=0;h<n.length;h++)if(this.rules.other.blockquoteStart.test(n[h]))o.push(n[h]),l=!0;else if(!l)o.push(n[h]);else break;n=n.slice(h);let p=o.join(`
|
|
16
|
+
`),f=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
17
17
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
18
|
-
${
|
|
19
|
-
${f}`:f;let
|
|
18
|
+
${p}`:p,r=r?`${r}
|
|
19
|
+
${f}`:f;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,i,!0),this.lexer.state.top=m,n.length===0)break;let g=i.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let y=g,k=y.raw+`
|
|
20
20
|
`+n.join(`
|
|
21
|
-
`),R=this.blockquote(
|
|
21
|
+
`),R=this.blockquote(k);i[i.length-1]=R,s=s.substring(0,s.length-y.raw.length)+R.raw,r=r.substring(0,r.length-y.text.length)+R.text;break}else if(g?.type==="list"){let y=g,k=y.raw+`
|
|
22
22
|
`+n.join(`
|
|
23
|
-
`),R=this.list(
|
|
24
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:
|
|
25
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,O=>" ".repeat(3*O.length)),g=
|
|
26
|
-
`,1)[0],m
|
|
27
|
-
`,
|
|
28
|
-
`,1)[0],
|
|
29
|
-
`+
|
|
30
|
-
`+g}!
|
|
31
|
-
`,
|
|
32
|
-
`):[],
|
|
33
|
-
`?
|
|
34
|
-
`),this.blockTokens(
|
|
35
|
-
`:
|
|
23
|
+
`),R=this.list(k);i[i.length-1]=R,s=s.substring(0,s.length-g.raw.length)+R.raw,r=r.substring(0,r.length-y.raw.length)+R.raw,n=k.substring(i.at(-1).raw.length).split(`
|
|
24
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let i=this.rules.other.listItemRegex(n),l=!1;for(;e;){let h=!1,p="",f="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let m=t[2].split(`
|
|
25
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,O=>" ".repeat(3*O.length)),g=e.split(`
|
|
26
|
+
`,1)[0],y=!m.trim(),k=0;if(this.options.pedantic?(k=2,f=m.trimStart()):y?k=t[1].length+1:(k=t[2].search(this.rules.other.nonSpaceChar),k=k>4?1:k,f=m.slice(k),k+=t[1].length),y&&this.rules.other.blankLine.test(g)&&(p+=g+`
|
|
27
|
+
`,e=e.substring(g.length+1),h=!0),!h){let O=this.rules.other.nextBulletRegex(k),M=this.rules.other.hrRegex(k),c=this.rules.other.fencesBeginRegex(k),u=this.rules.other.headingBeginRegex(k),x=this.rules.other.htmlBeginRegex(k);for(;e;){let w=e.split(`
|
|
28
|
+
`,1)[0],S;if(g=w,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),S=g):S=g.replace(this.rules.other.tabCharGlobal," "),c.test(g)||u.test(g)||x.test(g)||O.test(g)||M.test(g))break;if(S.search(this.rules.other.nonSpaceChar)>=k||!g.trim())f+=`
|
|
29
|
+
`+S.slice(k);else{if(y||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||c.test(m)||u.test(m)||M.test(m))break;f+=`
|
|
30
|
+
`+g}!y&&!g.trim()&&(y=!0),p+=w+`
|
|
31
|
+
`,e=e.substring(w.length+1),m=S.slice(k)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(l=!0));let R=null,U;this.options.gfm&&(R=this.rules.other.listIsTask.exec(f),R&&(U=R[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:p,task:!!R,checked:U,loose:!1,text:f,tokens:[]}),r.raw+=p}let o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let h=0;h<r.items.length;h++)if(this.lexer.state.top=!1,r.items[h].tokens=this.lexer.blockTokens(r.items[h].text,[]),!r.loose){let p=r.items[h].tokens.filter(m=>m.type==="space"),f=p.length>0&&p.some(m=>this.rules.other.anyLine.test(m.raw));r.loose=f}if(r.loose)for(let h=0;h<r.items.length;h++)r.items[h].loose=!0;return r}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ce(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
32
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<n.length;l++)i.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:i.align[l]});for(let l of r)i.rows.push(ce(l,i.header.length).map((o,h)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[h]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
33
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=G(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=gt(t[2],"()");if(i===-2)return;if(i>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let s=t[2],r="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),he(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[s.toLowerCase()];if(!r){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return he(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let i=[...s[0]].length-1,l,o,h=i,p=0,f=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+i);(s=f.exec(t))!=null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(o=[...l].length,s[3]||s[4]){h+=o;continue}else if((s[5]||s[6])&&i%3&&!((i+o)%3)){p+=o;continue}if(h-=o,h>0)continue;o=Math.min(o,o+h+p);let m=[...s[0]][0].length,g=e.slice(0,i+s.index+m+o);if(Math.min(i,o)%2){let k=g.slice(1,-1);return{type:"em",raw:g,text:k,tokens:this.lexer.inlineTokens(k)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let 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){let t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="mailto:"+n;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);n=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},A=class a{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||I,this.options.tokenizer=this.options.tokenizer||new B,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:$,block:K.normal,inline:q.normal};this.options.pedantic?(t.block=K.pedantic,t.inline=q.pedantic):this.options.gfm&&(t.block=K.gfm,this.options.breaks?t.inline=q.breaks:t.inline=q.gfm),this.tokenizer.rules=t}static get rules(){return{block:K,inline:q}}static lex(e,t){return new a(t).lex(e)}static lexInline(e,t){return new a(t).inlineTokens(e)}lex(e){e=e.replace($.carriageReturn,`
|
|
34
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace($.tabCharGlobal," ").replace($.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(i=>(s=i.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let i=t.at(-1);s.raw.length===1&&i!==void 0?i.raw+=`
|
|
35
|
+
`:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=`
|
|
36
36
|
`+s.raw,i.text+=`
|
|
37
|
-
`+s.text,this.inlineQueue
|
|
37
|
+
`+s.text,this.inlineQueue.at(-1).src=i.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=`
|
|
38
38
|
`+s.raw,i.text+=`
|
|
39
|
-
`+s.raw,this.inlineQueue
|
|
39
|
+
`+s.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let r=e;if(this.options.extensions?.startBlock){let i=1/0,l=e.slice(1),o;this.options.extensions.startBlock.forEach(h=>{o=h.call({lexer:this},l),typeof o=="number"&&o>=0&&(i=Math.min(i,o))}),i<1/0&&i>=0&&(r=e.substring(0,i+1))}if(this.state.top&&(s=this.tokenizer.paragraph(r))){let i=t.at(-1);n&&i?.type==="paragraph"?(i.raw+=`
|
|
40
40
|
`+s.raw,i.text+=`
|
|
41
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue
|
|
41
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(s),n=r.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let i=t.at(-1);i?.type==="text"?(i.raw+=`
|
|
42
42
|
`+s.raw,i.text+=`
|
|
43
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue
|
|
44
|
-
`;return s?'<pre><code class="language-'+
|
|
45
|
-
`:"<pre><code>"+(n?
|
|
46
|
-
`}blockquote({tokens:
|
|
47
|
-
${this.parser.parse(
|
|
48
|
-
`}html({text:
|
|
49
|
-
`}hr(
|
|
50
|
-
`}list(
|
|
51
|
-
`+s+"</"+
|
|
52
|
-
`}listitem(
|
|
53
|
-
`}checkbox({checked:
|
|
54
|
-
`}table(
|
|
43
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(s);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let r=!1,i="";for(;e;){r||(i=""),r=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let h=t.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,n,i)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let o=e;if(this.options.extensions?.startInline){let h=1/0,p=e.slice(1),f;this.options.extensions.startInline.forEach(m=>{f=m.call({lexer:this},p),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(o=e.substring(0,h+1))}if(l=this.tokenizer.inlineText(o)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(i=l.raw.slice(-1)),r=!0;let h=t.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):t.push(l);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}},N=class{options;parser;constructor(e){this.options=e||I}space(e){return""}code({text:e,lang:t,escaped:n}){let s=(t||"").match($.notSpaceStart)?.[0],r=e.replace($.endingNewline,"")+`
|
|
44
|
+
`;return s?'<pre><code class="language-'+C(s)+'">'+(n?r:C(r,!0))+`</code></pre>
|
|
45
|
+
`:"<pre><code>"+(n?r:C(r,!0))+`</code></pre>
|
|
46
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
47
|
+
${this.parser.parse(e)}</blockquote>
|
|
48
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
49
|
+
`}hr(e){return`<hr>
|
|
50
|
+
`}list(e){let t=e.ordered,n=e.start,s="";for(let l=0;l<e.items.length;l++){let o=e.items[l];s+=this.listitem(o)}let r=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+r+i+`>
|
|
51
|
+
`+s+"</"+r+`>
|
|
52
|
+
`}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+C(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
53
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
54
|
+
`}table(e){let t="",n="";for(let r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});let s="";for(let r=0;r<e.rows.length;r++){let i=e.rows[r];n="";for(let l=0;l<i.length;l++)n+=this.tablecell(i[l]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
55
55
|
<thead>
|
|
56
|
-
`+
|
|
56
|
+
`+t+`</thead>
|
|
57
57
|
`+s+`</table>
|
|
58
|
-
`}tablerow({text:
|
|
59
|
-
${
|
|
60
|
-
`}tablecell(
|
|
61
|
-
`}strong({tokens:
|
|
62
|
-
`+this.renderer.text(l);
|
|
63
|
-
Please report this to https://github.com/markedjs/marked.`,
|
|
58
|
+
`}tablerow({text:e}){return`<tr>
|
|
59
|
+
${e}</tr>
|
|
60
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
61
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${C(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let s=this.parser.parseInline(n),r=oe(e);if(r===null)return s;e=r;let i='<a href="'+e+'"';return t&&(i+=' title="'+C(t)+'"'),i+=">"+s+"</a>",i}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=oe(e);if(r===null)return C(n);e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${C(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:C(e.text)}},D=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},v=class a{options;renderer;textRenderer;constructor(e){this.options=e||I,this.options.renderer=this.options.renderer||new N,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new D}static parse(e,t){return new a(t).parse(e)}static parseInline(e,t){return new a(t).parseInline(e)}parse(e,t=!0){let n="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let l=r,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){n+=o||"";continue}}let i=r;switch(i.type){case"space":{n+=this.renderer.space(i);continue}case"hr":{n+=this.renderer.hr(i);continue}case"heading":{n+=this.renderer.heading(i);continue}case"code":{n+=this.renderer.code(i);continue}case"table":{n+=this.renderer.table(i);continue}case"blockquote":{n+=this.renderer.blockquote(i);continue}case"list":{n+=this.renderer.list(i);continue}case"html":{n+=this.renderer.html(i);continue}case"paragraph":{n+=this.renderer.paragraph(i);continue}case"text":{let l=i,o=this.renderer.text(l);for(;s+1<e.length&&e[s+1].type==="text";)l=e[++s],o+=`
|
|
62
|
+
`+this.renderer.text(l);t?n+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):n+=o;continue}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,t=this.renderer){let n="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let l=this.options.extensions.renderers[r.type].call({parser:this},r);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=l||"";continue}}let i=r;switch(i.type){case"escape":{n+=t.text(i);break}case"html":{n+=t.html(i);break}case"link":{n+=t.link(i);break}case"image":{n+=t.image(i);break}case"strong":{n+=t.strong(i);break}case"em":{n+=t.em(i);break}case"codespan":{n+=t.codespan(i);break}case"br":{n+=t.br(i);break}case"del":{n+=t.del(i);break}case"text":{n+=t.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}},P=class{options;block;constructor(e){this.options=e||I}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?A.lex:A.lexInline}provideParser(){return this.block?v.parse:v.parseInline}},X=class{defaults=W();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=v;Renderer=N;TextRenderer=D;Lexer=A;Tokenizer=B;Hooks=P;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{let r=s;for(let i of r.header)n=n.concat(this.walkTokens(i.tokens,t));for(let i of r.rows)for(let l of i)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,t));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let l=r[i].flat(1/0);n=n.concat(this.walkTokens(l,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=t.renderers[r.name];i?t.renderers[r.name]=function(...l){let o=r.renderer.apply(this,l);return o===!1&&(o=i.apply(this,l)),o}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[r.level];i?i.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),s.extensions=t),n.renderer){let r=this.defaults.renderer||new N(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,o=n.renderer[l],h=r[l];r[l]=(...p)=>{let f=o.apply(r,p);return f===!1&&(f=h.apply(r,p)),f||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new B(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,o=n.tokenizer[l],h=r[l];r[l]=(...p)=>{let f=o.apply(r,p);return f===!1&&(f=h.apply(r,p)),f}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new P;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,o=n.hooks[l],h=r[l];P.passThroughHooks.has(i)?r[l]=p=>{if(this.defaults.async)return Promise.resolve(o.call(r,p)).then(m=>h.call(r,m));let f=o.call(r,p);return h.call(r,f)}:r[l]=(...p)=>{let f=o.apply(r,p);return f===!1&&(f=h.apply(r,p)),f}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(l){let o=[];return o.push(i.call(this,l)),r&&(o=o.concat(r.call(this,l))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return A.lex(e,t??this.defaults)}parser(e,t){return v.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{let r={...s},i={...this.defaults,...r},l=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?A.lex:A.lexInline,h=i.hooks?i.hooks.provideParser():e?v.parse:v.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(p=>o(p,i)).then(p=>i.hooks?i.hooks.processAllTokens(p):p).then(p=>i.walkTokens?Promise.all(this.walkTokens(p,i.walkTokens)).then(()=>p):p).then(p=>h(p,i)).then(p=>i.hooks?i.hooks.postprocess(p):p).catch(l);try{i.hooks&&(n=i.hooks.preprocess(n));let p=o(n,i);i.hooks&&(p=i.hooks.processAllTokens(p)),i.walkTokens&&this.walkTokens(p,i.walkTokens);let f=h(p,i);return i.hooks&&(f=i.hooks.postprocess(f)),f}catch(p){return l(p)}}}onError(e,t){return n=>{if(n.message+=`
|
|
63
|
+
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+C(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},E=new X;function b(a,e){return E.parse(a,e)}b.options=b.setOptions=function(a){return E.setOptions(a),b.defaults=E.defaults,pe(b.defaults),b};b.getDefaults=W;b.defaults=I;b.use=function(...a){return E.use(...a),b.defaults=E.defaults,pe(b.defaults),b};b.walkTokens=function(a,e){return E.walkTokens(a,e)};b.parseInline=E.parseInline;b.Parser=v;b.parser=v.parse;b.Renderer=N;b.TextRenderer=D;b.Lexer=A;b.lexer=A.lex;b.Tokenizer=B;b.Hooks=P;b.parse=b;var xt=b.options,mt=b.setOptions,_t=b.use,wt=b.walkTokens,yt=b.parseInline,ye=b,Tt=v.parse,St=A.lex;var Re=Pe(Se(),1),$e={meta:{type:"const",value:{pluginName:"plugin_markup",description:"HTML\u6574\u5F62\u3084\u30DE\u30FC\u30AF\u30C0\u30A6\u30F3\u5909\u63DB\u306A\u3069\u306E\u547D\u4EE4\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako"],nakoVersion:"3.6.0"}},\u30DE\u30FC\u30AF\u30C0\u30A6\u30F3HTML\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(a){return ye(a)}},HTML\u6574\u5F62:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(a){return Re.default.prettyPrint(a,{indent_size:2})}}},vt=$e;typeof navigator=="object"&&typeof navigator.nako3=="object"&&navigator.nako3.addPluginObject("PluginMarkup",$e);})();
|
|
64
64
|
//# sourceMappingURL=plugin_markup.js.map
|