@ministryofjustice/fb-nunjucks-helpers
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -8,3 +8,3 @@ const nunjucksMacroHelpers = require('./nunjucks-macro-helpers') | ||
nunjucksEnv.addFilter('addBlockInfo', (str, params) => { | ||
const output = str.replace(/(<div[^>]+)/, `$1 data-block-id="${params._id}" data-block-type="${params._type}"`) | ||
const output = str.replace(/\s*(<\w+[^>]+)/, `$1 data-block-id="${params._id}" data-block-type="${params._type}"`) | ||
.replace(/(govuk-form-group)/, `$1 fb-block-${params._type}`) | ||
@@ -11,0 +11,0 @@ return output |
@@ -42,3 +42,4 @@ | ||
// let macroNjk = macroPath.replace(/.*\/template\/nunjucks\/(.+)\.njk?$/, '$1') | ||
let macroNjk = macroPath.replace(/.*\/(.+)\.njk?$/, '$1') | ||
// let macroNjk = macroPath.replace(/.*\/(.+)\.njk?$/, '$1') | ||
let macroNjk = macroPath.replace(/.*\/(.+)\.njk$/, '$1') | ||
const macroNamespaceSuffix = macroNjk.includes('.') ? macroNjk.replace(/\.[^.]+$/, '') : '' | ||
@@ -45,0 +46,0 @@ if (macroNamespaceSuffix) { |
{ | ||
"name": "@ministryofjustice/fb-nunjucks-helpers", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Form Builder Nunjucks helpers", | ||
@@ -5,0 +5,0 @@ "main": "lib/fb-nunjucks-helpers.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25545
579