//встройка локализации
lang = JSON.parse(lang_json);
for (var key in lang) {
html = html.replace(new RegExp("<locale>"+key+"</locale>","g"), lang[key]);
}
//импорт css
css = html.match(/@css-(.*?);/g);
css.forEach(function(item) {
get_css = $.ajax({url: item, cache: true, async: false}).responseText;
html = html.replace(new RegExp("@css-"+item+";","g"), "<style>"+get_css+"</style>")
});
//вставка данных из масива
for (var key in arr) {
html = html.replace(new RegExp("<arr>"+key+"</arr>","g"), arr[key])
}
<if value = "i == true">
//тут что то делаем с i.
<else>
//обрабатываем
</if>
var ifs = html.match(/<if>(.*?)<\/if>/g);
ifs.forEach(function(item) {
var logik = item.match(/<logik>(.*?)<\/logik>/g);
logik = logik[0];
logik = logik.replace('<logik>','');
logik = logik.replace('</logik>','');
var block_if = item.match(/<\/logik>(.*?)<else>/g);
block_if = block_if[0];
block_if = block_if.replace('<\/logik>',' ');
block_if = block_if.replace('<else>',' ');
var block_else = item.match(/<else>(.*?)<\/if>/g);
block_else = block_else[0];
block_else = block_else.replace('<else>',' ');
block_else = block_else.replace('<\/if>',' ');
var inners;
eval("if("+logik+"){inners='"+block_if+"'}else{inners='"+block_else+"'}");
html = html.replace(new RegExp(item,"g"), inners)
});
<if><logik>{{.boll}} == true</logik>
<h1>заголовок</h1>
<else>
не заголовок
</if>