Skip to content

Commit

Permalink
Update JSDoc example with | safe already applied
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Nov 30, 2023
1 parent 283be0e commit 18f545a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/filters/core-filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ runWhenEnvIsAvailable(() => {
/**
* Logs an object in the template to the console in the browser.
*
* @example {{ "hello world" | log }}
* @example {{ "hello world" | log | safe }} [for environments with autoescaping turned on]
* @param {any} a - any type
* @example
* ```njk
* {{ "hello world" | log }}
* ```
* @param {any} a - any type
* @returns {string} a script tag with a console.log call.
*/
(a) => nunjucksSafe('<script>console.log(' + JSON.stringify(a, null, '\t') + ');</script>')
Expand Down

0 comments on commit 18f545a

Please sign in to comment.