UNPKG

@horojs/core

Version:

A micro library for a reactive UI application.

3 lines (2 loc) 517 B
import{insertionPrefix as t,eventHandlingPrefix as $,attrsPrefix as e}from"../instruction.js";const r=/(<[a-z\=\"\s\-]* )([a-z\-\@]*)="?$/im;function c(c){let o=c[0];for(let l=1;l<c.length;l++){const a=c[l],i=o.match(r);o=null===i?`${o}\x3c!--${t}${l-1}--\x3e${a}`:i[2].startsWith($)?`${o.replace(r,`\x3c!--$2:${l-1}--\x3e$1`)}${n(a)}`:`${o.replace(r,`\x3c!--${e}$2:${l-1}--\x3e$1`)}${n(a)}`}return o}function n(t){return t.replace(/^(["])/m,"")}export{c as parseTemplate}; //# sourceMappingURL=parse-template.js.map