=p)return!1;for(l=s,(u=n.md.helpers.parseLinkDestination(n.src,s,n.posMax)).ok&&(c=n.md.normalizeLink(u.str),n.md.validateLink(c)?s=u.pos:c=""),l=s;s=p||41!==n.src.charCodeAt(s))return n.pos=h,!1;s++}else{if(void 0===n.env.references)return!1;if(s
=t)return!1;let e=n.src.charCodeAt(r);if(60===e)return!1;if(62===e)break}var s=n.src.slice(e+1,r);if(Ye.test(s)){let r=n.md.normalizeLink(s);if(!n.md.validateLink(r))return!1;if(!i){let e=n.push("link_open","a",1),t=(e.attrs=[["href",r]],e.markup="autolink",e.info="auto",n.push("text","",0).content=n.md.normalizeLinkText(s),n.push("link_close","a",-1));t.markup="autolink",t.info="auto"}return n.pos+=s.length+2,!0}if(Xe.test(s)){let r=n.md.normalizeLink("mailto:"+s);if(!n.md.validateLink(r))return!1;if(!i){let e=n.push("link_open","a",1),t=(e.attrs=[["href",r]],e.markup="autolink",e.info="auto",n.push("text","",0).content=n.md.normalizeLinkText(s),n.push("link_close","a",-1));t.markup="autolink",t.info="auto"}return n.pos+=s.length+2,!0}}return!1}],["html_inline",function(t,e){if(!t.md.options.html)return!1;var r=t.posMax,n=t.pos;if(60!==t.src.charCodeAt(n)||r<=n+2)return!1;var r=t.src.charCodeAt(n+1);if(33!==r&&63!==r&&47!==r&&!(97<=(r=32|r)&&r<=122))return!1;r=t.src.slice(n).match(Ue);if(!r)return!1;if(!e){let e=t.push("html_inline","",0);e.content=r[0],n=e.content,/^\s]/i.test(n)&&t.linkLevel++,/^<\/a\s*>/i.test(e.content)&&t.linkLevel--}return t.pos+=r[0].length,!0}],["entity",function(n,e){let t=n.pos,r=n.posMax;if(38===n.src.charCodeAt(t)&&!(t+1>=r))if(35===n.src.charCodeAt(t+1)){let r=n.src.slice(t).match(Ke);if(r){if(!e){let e="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),t=n.push("text_special","",0);t.content=_e(e)?h(e):h(65533),t.markup=r[0],t.info="entity"}return n.pos+=r[0].length,!0}}else{let r=n.src.slice(t).match(et);if(r){let t=he(r[0]);if(t!==r[0]){if(!e){let e=n.push("text_special","",0);e.content=t,e.markup=r[0],e.info="entity"}return n.pos+=r[0].length,!0}}}return!1}]],nt=[["balance_pairs",function(e){var t=e.tokens_meta,r=e.tokens_meta.length;tt(e.delimiters);for(let e=0;e=r.pos)throw new Error("inline rule didn't increment state.pos");break}if(t){if(e<=r.pos)break}else r.pending+=r.src[r.pos++]}r.pending&&r.pushPending()},w.prototype.parse=function(e,t,r,n){var i=new this.State(e,t,r,n),s=(this.tokenize(i),this.ruler2.getRules("")),o=s.length;for(let e=0;e<|]|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}(),e=i.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}i.onCompile(),i.__tlds_replaced__||e.push(lt),e.push(t.src_xn),t.src_tlds=e.join("|"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");let s=[];function o(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}i.__compiled__={},Object.keys(i.__schemas__).forEach(function(e){var t,r,n=i.__schemas__[e];null!==n&&(i.__compiled__[e]=t={validate:null,link:null},"[object Object]"===z(n)?("[object RegExp]"!==z(n.validate)?st(n.validate)?t.validate=n.validate:o(e,n):t.validate=(r=n.validate,function(e,t){e=e.slice(t);return r.test(e)?e.match(r)[0].length:0}),st(n.normalize)?t.normalize=n.normalize:n.normalize?o(e,n):t.normalize=function(e,t){t.normalize(e)}):"[object String]"!==z(n)?o(e,n):s.push(e))}),s.forEach(function(e){i.__compiled__[i.__schemas__[e]]&&(i.__compiled__[e].validate=i.__compiled__[i.__schemas__[e]].validate,i.__compiled__[e].normalize=i.__compiled__[i.__schemas__[e]].normalize)}),i.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var n=Object.keys(i.__compiled__).filter(function(e){return 0<|]|"+t.src_ZPCc+"))("+n+")","i"),i.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+n+")","ig"),i.re.schema_at_start=RegExp("^"+i.re.schema_search.source,"i"),i.re.pretest=RegExp("("+i.re.schema_test.source+")|("+i.re.host_fuzzy_test.source+")|@","i"),(n=i).__index__=-1,n.__text_cache__=""}function pt(e,t){var r=e.__index__,n=e.__last_index__,i=e.__text_cache__.slice(r,n);this.schema=e.__schema__.toLowerCase(),this.index=r+t,this.lastIndex=n+t,this.raw=i,this.text=i,this.url=i}function ft(e,t){t=new pt(e,t);return e.__compiled__[t.schema].normalize(t,e),t}function S(e,t){if(!(this instanceof S))return new S(e,t);var r;t||(r=e,Object.keys(r||{}).reduce(function(e,t){return e||ut.hasOwnProperty(t)},!1)&&(t=e,e={})),this.__opts__=it({},ut,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=it({},at,e),this.__compiled__={},this.__tlds__=ct,this.__tlds_replaced__=!1,this.re={},ht(this)}S.prototype.add=function(e,t){return this.__schemas__[e]=t,ht(this),this},S.prototype.set=function(e){return this.__opts__=it(this.__opts__,e),this},S.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,r,n,i,s,o,u,a;if(this.re.schema_test.test(e))for((u=this.re.schema_search).lastIndex=0;null!==(t=u.exec(e));)if(i=this.testSchemaAt(e,t[2],u.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&0<=(a=e.search(this.re.host_fuzzy_test))&&(this.__index__<0||athis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=o),0<=this.__index__},S.prototype.pretest=function(e){return this.re.pretest.test(e)},S.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0},S.prototype.match=function(e){var t=[];let r=0,n=(0<=this.__index__&&this.__text_cache__===e&&(t.push(ft(this,r)),r=this.__last_index__),r?e.slice(r):e);for(;this.test(n);)t.push(ft(this,r)),n=n.slice(this.__last_index__),r+=this.__last_index__;return t.length?t:null},S.prototype.matchAtStart=function(e){var t;return this.__text_cache__=e,this.__index__=-1,e.length&&(t=this.re.schema_at_start.exec(e))&&(e=this.testSchemaAt(e,t[2],t[0].length))?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+e,ft(this,0)):null},S.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,r){return e!==r[t-1]}).reverse():(this.__tlds__=e.slice(),this.__tlds_replaced__=!0),ht(this),this},S.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},S.prototype.onCompile=function(){};let q=2147483647,B=36,dt=/^xn--/,_t=/[^\0-\x7F]/,mt=/[\x2E\u3002\uFF0E\uFF61]/g,gt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=Math.floor,kt=String.fromCharCode;function I(e){throw new RangeError(gt[e])}function Dt(e,t){var r=e.split("@");let n="";1>1,e+=L(e/t);455=s&&I("invalid-input");let e=48<=(l=i.charCodeAt(n++))&&l<58?l-48+26:65<=l&&l<91?l-65:97<=l&&l<123?l-97:B;e>=B&&I("invalid-input"),e>L((q-o)/t)&&I("overflow"),o+=e*t;var l=r<=u?1:r>=u+26?26:r-u;if(eL(q/l)&&I("overflow"),t*=l}var c=t.length+1;u=Et(o-e,c,0==e),L(o/c)>q-r&&I("overflow"),r+=L(o/c),o%=c,t.splice(o++,0,r)}return String.fromCodePoint(...t)}function Ft(r){let s=[],e=(r=Ct(r)).length,n=128,o=0,u=72;for(let e of r)e<128&&s.push(kt(e));let a=s.length,l=a;for(a&&s.push("-");l=n&&eL((q-o)/c)&&I("overflow"),o+=(t-n)*c,n=t;for(let e of r)if(eq&&I("overflow"),e===n){let i=o;for(let n=B;;n+=B){let e=n<=u?1:n>=u+26?26:n-u;if(iString.fromCodePoint(...e)},decode:At,encode:Ft,toASCII:function(e){return Dt(e,function(e){return _t.test(e)?"xn--"+Ft(e):e})},toUnicode:function(e){return Dt(e,function(e){return dt.test(e)?At(e.slice(4).toLowerCase()):e})}},vt={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},xt=/^(vbscript|javascript|file|data):/,wt=/^data:image\/(gif|png|jpeg|webp);/;function zt(e){e=e.trim().toLowerCase();return!xt.test(e)||wt.test(e)}let St=["http:","https:","mailto:"];function qt(e){var t=J(e,!0);if(t.hostname&&(!t.protocol||0<=St.indexOf(t.protocol)))try{t.hostname=bt.toASCII(t.hostname)}catch(e){}return r(i(t))}function Bt(e){var t=J(e,!0);if(t.hostname&&(!t.protocol||0<=St.indexOf(t.protocol)))try{t.hostname=bt.toUnicode(t.hostname)}catch(e){}return n(i(t),n.defaultChars+"%")}function M(e,t){if(!(this instanceof M))return new M(e,t);t||pe(e)||(t=e||{},e="default"),this.inline=new w,this.block=new b,this.core=new Re,this.renderer=new d,this.linkify=new S,this.validateLink=zt,this.normalizeLink=qt,this.normalizeLinkText=Bt,this.utils=Fe,this.helpers=c({},be),this.options={},this.configure(e),t&&this.set(t)}return M.prototype.set=function(e){return c(this.options,e),this},M.prototype.configure=function(t){let r=this;if(pe(t)){let e=t;if(!(t=vt[e]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name')}if(t)return t.options&&r.set(t.options),t.components&&Object.keys(t.components).forEach(function(e){t.components[e].rules&&r[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&r[e].ruler2.enableOnly(t.components[e].rules2)}),this;throw new Error("Wrong `markdown-it` preset, can't be empty")},M.prototype.enable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){r=r.concat(this[e].ruler.enable(t,!0))},this),r=r.concat(this.inline.ruler2.enable(t,!0));var n=t.filter(function(e){return r.indexOf(e)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},M.prototype.disable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){r=r.concat(this[e].ruler.disable(t,!0))},this),r=r.concat(this.inline.ruler2.disable(t,!0));var n=t.filter(function(e){return r.indexOf(e)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},M.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},M.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");e=new this.core.State(e,this,t);return this.core.process(e),e.tokens},M.prototype.render=function(e,t){return this.renderer.render(this.parse(e,t=t||{}),this.options,t)},M.prototype.parseInline=function(e,t){e=new this.core.State(e,this,t);return e.inlineMode=!0,this.core.process(e),e.tokens},M.prototype.renderInline=function(e,t){return this.renderer.render(this.parseInline(e,t=t||{}),this.options,t)},M});
\ No newline at end of file
diff --git a/src/wxcomponents/agent-ui/wd-markdown/utils/plugin.js b/src/wxcomponents/agent-ui/wd-markdown/utils/plugin.js
deleted file mode 100755
index b8c02fd..0000000
--- a/src/wxcomponents/agent-ui/wd-markdown/utils/plugin.js
+++ /dev/null
@@ -1,55 +0,0 @@
-const options = {
- paragraph_open: "_p",
- bullet_list_open: "_ul",
- ordered_list_open: "_ol",
- hr: "_hr",
- link_open: "_a",
- blockquote_open: "_blockquote",
- table_open: "_table",
- thead_open: "_thead",
- tr_open: "_tr",
- th_open: "_th",
- td_open: "_td",
-};
-export function addCustomClassPlugin(md) {
- md.renderer.rules.heading_open = (tokens, idx, options, env, self) => {
- const token = tokens[idx];
- // console.log(token)
- // 判断当前标签是否为 h1
- if (["h1", "h2", "h3", "h4", "h5", "h6"].includes(token.tag)) {
- // 给 h1 标签添加 class 属性
- token.attrJoin("class", `_${token.tag}`);
- }
- return self.renderToken(tokens, idx, options);
- };
- Object.keys(options).forEach((key) => {
- const className = options[key];
- md.renderer.rules[key] = (tokens, idx, options, env, self) => {
- tokens[idx].attrPush(["class", className]);
- return self.renderToken(tokens, idx, options);
- };
- });
-}
-function renderCode(origRule) {
- return (...args) => {
- const [tokens, idx] = args;
- const content = tokens[idx].content
- .replaceAll('"', '"')
- .replaceAll("'", "'");
- const origRendered = origRule(...args);
-
- if (content.length === 0)
- return origRendered;
-
- return `
-
-`;
- };
-}
-export const copy = (md) => {
- md.renderer.rules.code_block = renderCode(md.renderer.rules.code_block);
- md.renderer.rules.fence = renderCode(md.renderer.rules.fence);
-};
\ No newline at end of file