olum-compiler 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler.js +9 -1
- package/package.json +1 -1
package/compiler.js
CHANGED
|
@@ -299,7 +299,15 @@ class Compiler {
|
|
|
299
299
|
const template = isFullArr(tempArr) ? tempArr[0] : ""; // get 1st template tag as the order of component file
|
|
300
300
|
const markup = template.replace(this.regex.template.tag, "");
|
|
301
301
|
const cleanHTML = markup.replace(this.regex.template.comment, ""); // clean html from comments
|
|
302
|
-
const html =
|
|
302
|
+
const html = `
|
|
303
|
+
template(arg) {
|
|
304
|
+
var olumTempOpeningTag = new RegExp("<[aA-zZ][\\\\s\\\\S]*?>");
|
|
305
|
+
var olumTempClosingTag = new RegExp("(</[aA-zZ]+>)$", "g");
|
|
306
|
+
var olumTemp = \`\n${cleanHTML}\n\`;
|
|
307
|
+
if (arg && arg === true) olumTemp = olumTemp.trim().replace(olumTempOpeningTag, '').replace(olumTempClosingTag, '');
|
|
308
|
+
return olumTemp;
|
|
309
|
+
}
|
|
310
|
+
`;
|
|
303
311
|
resolve(html);
|
|
304
312
|
});
|
|
305
313
|
}
|