neobiz 1.3.6 → 1.3.9

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/index.js +24 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -35,13 +35,31 @@ function render(val = {}) {
35
35
  typeof k[1] == "string" ? inn : inn.substring(0, inn.length - 1);
36
36
  } else temp.push(k);
37
37
  });
38
- const stat = !["input", "link", "br", "hr"].includes(e[0]);
39
- if (stat) result += ">";
38
+ const stat = ![
39
+ "input",
40
+ "link",
41
+ "br",
42
+ "hr",
43
+ "area",
44
+ "base",
45
+ "br",
46
+ "col",
47
+ "embed",
48
+ "img",
49
+ "meta",
50
+ "param",
51
+ "source",
52
+ "track",
53
+ "wbr",
54
+ ].includes(e[0]);
40
55
  result += inn;
41
- for (let i of temp) result += render({ [i[0]]: i[1] });
42
- if (stat) result += `</${e[0]}>`;
43
- else result += "/>";
44
- } else {
56
+ for (let i of temp)
57
+ if (stat) {
58
+ result += ">";
59
+ result += render({ [i[0]]: i[1] });
60
+ result += `</${e[0]}>`;
61
+ }
62
+ if (!stat) result += "/>";
45
63
  }
46
64
  });
47
65
  result = result.replace(/[\r\n\t]/gm, "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neobiz",
3
- "version": "1.3.6",
3
+ "version": "1.3.9",
4
4
  "description": "A simple view engine with JS features",
5
5
  "main": "index.js",
6
6
  "scripts": {