Skip to content

Commit

Permalink
Merged branch bug_76 into type_rich_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
wonknu committed Dec 14, 2016
2 parents 6de5268 + 7a80237 commit c1ceb5f
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/cli/cms/templates/prepare.js
Expand Up @@ -87,23 +87,25 @@ export function addAbeDataAttrForHtmlAttributes(template, key) {
var text = template.replace(/<([A-Za-z]+)/g, '\nABE_SPLIT<$1')
let abeTagIntoAttribute = text.match(cmsData.regex.abeAsAttributePattern)

Array.prototype.forEach.call(abeTagIntoAttribute, (abeIntoTag) => {
let matchAbeTag = /({{abe.*?[\s\S].*?}})/g.exec(abeIntoTag)

if(matchAbeTag != null && matchAbeTag[1] != null) {
var toReplace = cmsTemplates.prepare.getAbeAttributeData(matchAbeTag[1], text, (abeIntoTag.split('=')[0]).trim(), abeIntoTag)

toReplace = toReplace.replace(
cmsData.regex.escapeTextToRegex(matchAbeTag[1]),
cmsTemplates.prepare.addHasAbeAttr(matchAbeTag[1])
)

text = text.replace(
cmsData.regex.escapeTextToRegex(abeIntoTag),
toReplace
)
}
})
if (abeTagIntoAttribute != null) {
Array.prototype.forEach.call(abeTagIntoAttribute, (abeIntoTag) => {
let matchAbeTag = /({{abe.*?[\s\S].*?}})/g.exec(abeIntoTag)

if(matchAbeTag != null && matchAbeTag[1] != null) {
var toReplace = cmsTemplates.prepare.getAbeAttributeData(matchAbeTag[1], text, (abeIntoTag.split('=')[0]).trim(), abeIntoTag)

toReplace = toReplace.replace(
cmsData.regex.escapeTextToRegex(matchAbeTag[1]),
cmsTemplates.prepare.addHasAbeAttr(matchAbeTag[1])
)

text = text.replace(
cmsData.regex.escapeTextToRegex(abeIntoTag),
toReplace
)
}
})
}
text = text.replace(/\nABE_SPLIT</g, '<')

return text
Expand Down

0 comments on commit c1ceb5f

Please sign in to comment.