Skip to content

Commit

Permalink
Enhancement: refining the detection of abe tags including variables i…
Browse files Browse the repository at this point in the history
…n each statements
  • Loading branch information
gregorybesson committed Jan 1, 2017
1 parent 9295ed8 commit 1286b0c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cli/cms/templates/prepare.js
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1286b0c

Please sign in to comment.