mikel 0.16.0 → 0.17.0

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 (3) hide show
  1. package/README.md +10 -0
  2. package/index.js +1 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -311,6 +311,16 @@ const data = {
311
311
  console.log(m("{{#with autor}}{{name}} <{{email}}>{{/with}}", data)); // --> 'Bob <bob@email.com>'
312
312
  ```
313
313
 
314
+ #### escape
315
+
316
+ > Added in `v0.17.0`.
317
+
318
+ The `escape` helper allows to escape the provided block content.
319
+
320
+ ```javascript
321
+ console.log(m("{{#escape}}<b>Hello World!</b>{{/escape}}")); // --> '&lt;b&gt;Hello World!&lt;/b&gt;
322
+ ```
323
+
314
324
  ### Custom Helpers
315
325
 
316
326
  > Added in `v0.5.0`.
package/index.js CHANGED
@@ -61,6 +61,7 @@ const defaultHelpers = {
61
61
  "eq": p => p.args[0] === p.args[1] ? p.fn(p.context) : "",
62
62
  "ne": p => p.args[0] !== p.args[1] ? p.fn(p.context) : "",
63
63
  "with": p => p.fn(p.args[0]),
64
+ "escape": p => escape(p.fn(p.context)),
64
65
  };
65
66
 
66
67
  // @description create a new instance of mikel
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mikel",
3
3
  "description": "Micro templating library with zero dependencies",
4
- "version": "0.16.0",
4
+ "version": "0.17.0",
5
5
  "type": "module",
6
6
  "author": {
7
7
  "name": "Josemi Juanes",