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.
Files changed (2) hide show
  1. package/compiler.js +9 -1
  2. 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 = "\n template() { \n return `" + cleanHTML + "`;\n}\n";
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "olum-compiler",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "A module for compiling/bundling olumjs projects",
5
5
  "main": "bin/index.js",
6
6
  "bin": {