import{c as e}from"./micromark-util-character-DUwsRT9L.js";function r(r){const o=[];let t=-1,n=0,c=0;for(;++t<r.length;){const a=r.charCodeAt(t);let i="";if(37===a&&e(r.charCodeAt(t+1))&&e(r.charCodeAt(t+2)))c=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){const e=r.charCodeAt(t+1);a<56320&&e>56319&&e<57344?(i=String.fromCharCode(a,e),c=1):i="�"}else i=String.fromCharCode(a);i&&(o.push(r.slice(n,t),encodeURIComponent(i)),n=t+c+1,i=""),c&&(t+=c,c=0)}return o.join("")+r.slice(n)}export{r as n};
