diff --git a/src/cli/cms/templates/prepare.js b/src/cli/cms/templates/prepare.js index 27c4be06..6411f08c 100755 --- a/src/cli/cms/templates/prepare.js +++ b/src/cli/cms/templates/prepare.js @@ -145,8 +145,7 @@ export function addAbeDataAttrForHtmlAttributes(template) { * @param {[type]} json [description] */ export function addAbeSourceComment(template, json) { - - // Don't know what it does... + if(typeof json.abe_source !== 'undefined' && json.abe_source !== null) { var keys = Object.keys(json.abe_source) @@ -264,7 +263,7 @@ export function indexEachBlocks(template, onlyHtml) { var voidData = {} voidData[key] = [{}] - var blockCompiled = Handlebars.compile(block.replace(/{{abe (.*?)["'] ?}}/g, '[[abe $1]]').replace(new RegExp(`\\.\\.\/${config.meta.name}`, 'g'), config.meta.name)) + var blockCompiled = Handlebars.compile(block.replace(/{{abe (.*?["']) ?}}/g, '[[abe $1]]').replace(new RegExp(`\\.\\.\/${config.meta.name}`, 'g'), config.meta.name)) var blockHtml = blockCompiled(voidData, {data: {intl: config.intlData}}).replace(/\[\[abe (.*?)\]\]/g, '{{abe $1}}') // je rajoute un data-abe-block avec index sur tous les tags html du bloc each