"use strict";const S=require("./markup.cjs.js");g.displayName="markup-templating";g.aliases=[];function g(l){l.register(S),(function(o){function y(t,a){return"___"+t.toUpperCase()+a+"___"}Object.defineProperties(o.languages["markup-templating"]={},{buildPlaceholders:{value:function(t,a,f,c){if(t.language===a){var u=t.tokenStack=[];t.code=t.code.replace(f,function(n){if(typeof c=="function"&&!c(n))return n;for(var i=u.length,r;t.code.indexOf(r=y(a,i))!==-1;)++i;return u[i]=n,r}),t.grammar=o.languages.markup}}},tokenizePlaceholders:{value:function(t,a){if(t.language!==a||!t.tokenStack)return;t.grammar=o.languages[a];var f=0,c=Object.keys(t.tokenStack);function u(n){for(var i=0;i<n.length&&!(f>=c.length);i++){var r=n[i];if(typeof r=="string"||r.content&&typeof r.content=="string"){var k=c[f],d=t.tokenStack[k],p=typeof r=="string"?r:r.content,h=y(a,k),s=p.indexOf(h);if(s>-1){++f;var v=p.substring(0,s),b=new o.Token(a,o.tokenize(d,t.grammar),"language-"+a,d),_=p.substring(s+h.length),e=[];v&&e.push.apply(e,u([v])),e.push(b),_&&e.push.apply(e,u([_])),typeof r=="string"?n.splice.apply(n,[i,1].concat(e)):r.content=e}}else r.content&&u(r.content)}return n}u(t.tokens)}}})})(l)}module.exports=g;
//# sourceMappingURL=markup-templating.cjs.js.map
