const l=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function f(n,p){const r=n.posMax,o=n.pos;if(n.src.charCodeAt(o)!==94||p||o+2>=r)return!1;n.pos=o+1;let s=!1;for(;n.pos<r;){if(n.src.charCodeAt(n.pos)===94){s=!0;break}n.md.inline.skipToken(n)}if(!s||o+1===n.pos)return n.pos=o,!1;const u=n.src.slice(o+1,n.pos);if(u.match(/(^|[^\\])(\\\\)*\s/))return n.pos=o,!1;n.posMax=n.pos,n.pos=o+1;const c=n.push("sup_open","sup",1);c.markup="^";const e=n.push("text","",0);e.content=u.replace(l,"$1");const i=n.push("sup_close","sup",-1);return i.markup="^",n.pos=n.posMax+1,n.posMax=r,!0}function t(n){n.inline.ruler.after("emphasis","sup",f)}export{t as default};
