ventojs 1.15.0 → 1.15.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"auto_trim.d.ts","sourceRoot":"","sources":["../../src/plugins/auto_trim.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAe,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEjE,eAAO,MAAM,WAAW,UAgBvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEjD,MAAM,CAAC,OAAO,WACZ,OAAO,GAAE,eAAuC,GAC/C,MAAM,CAIR;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,eAAe,QAoBjE"}
1
+ {"version":3,"file":"auto_trim.d.ts","sourceRoot":"","sources":["../../src/plugins/auto_trim.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAe,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEjE,eAAO,MAAM,WAAW,UAgBvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEjD,MAAM,CAAC,OAAO,WACZ,OAAO,GAAE,eAAuC,GAC/C,MAAM,CAIR;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,eAAe,QAuBjE"}
@@ -27,7 +27,8 @@ export function autoTrim(tokens, options) {
27
27
  const token = tokens[i];
28
28
  const next = tokens[i + 1];
29
29
  const [type, code] = token;
30
- if (type === "tag" && options.tags.find((tag) => code.startsWith(tag))) {
30
+ if (type === "tag" &&
31
+ options.tags.find((tag) => code === tag || code.startsWith(tag + " "))) {
31
32
  // Remove leading horizontal space
32
33
  previous[1] = previous[1].replace(/(^|\n)[ \t]*$/, "$1");
33
34
  // Remove trailing horizontal space + newline
@@ -65,7 +65,7 @@ export class Environment {
65
65
  ${code}
66
66
  return __exports;
67
67
  } catch (cause) {
68
- const template = __env.cache.get(__file);
68
+ const template = ${sync ? "" : "await"} __env.cache.get(__file);
69
69
  throw new __err(__file, template?.source, __pos, cause);
70
70
  }
71
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ventojs",
3
- "version": "1.15.0",
3
+ "version": "1.15.2",
4
4
  "description": "🌬 A minimal but powerful template engine",
5
5
  "homepage": "https://vento.js.org/",
6
6
  "repository": "github:oscarotero/vento",