import{n as e,t}from"./mIAuGNVb.js";import{r as n}from"./DgyLeDN4.js";var r=/[\p{Emoji_Presentation}\p{Extended_Pictographic}]\uFE0F?/gu,i=/^\|[\s:|-]+\|$/,a=/^[ ]{0,3}([-*_])\s*(\1\s*){2,}$/,o=/<!--\s*followups:\s*\[.*?\]\s*-->\s*$/s,s=n;function c(e){let t=!1;return e.replace(/(<[^>]+>)|([^<]+)/g,(e,r,i)=>r?(/<code/i.test(r)&&(t=!0),/<\/code/i.test(r)&&(t=!1),r):!i||t?i??``:n(i.replace(/&quot;/g,`"`).replace(/&#39;/g,`'`)))}function l(e){return e.replace(o,``).trimEnd().replace(r,``).replace(/^ {2,}/gm,(e,t,n)=>{let r=n.slice(t+e.length);return/^([-*+]|\d+[.)])\s/.test(r)?e:` `}).split(`
`).map(e=>i.test(e)||a.test(e)?e:e.replace(/--/g,`—`)).join(`
`)}function u(e){return e.replace(/<a\s+href="([^"]*)"/gi,(e,t)=>/^(https?:)?\/\//i.test(t)||/^(mailto|tel):/i.test(t)?`<a href="${t}" target="_blank" rel="noopener noreferrer"`:e)}function d(n){return n.replace(/\[\[([^\]]+)\]\]/g,(n,r)=>{let i=e(r);return i?`[${i.title}](${i.url})`:`[${t(r)}](#)`})}export{s as a,c as i,u as n,d as r,l as t};