Skip to content

Commit

Permalink
fix: removing redundancy in a test + fixing a regex pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Jul 15, 2017
1 parent f0a3ef6 commit 4ddee5e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/cli/cms/templates/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,10 @@ export function setAbePrecontribDefaultValueIfDoesntExist(templateText) {
* @return {object} [description]
*/
export function getAbePrecontribFromTemplates(templatesList) {
var fields = []
var precontributionTemplate = []

// loop over template file
Array.prototype.forEach.call(templatesList, (file) => {
var slugMatch = cmsData.regex.getTagAbeWithType(file.template, 'slug')
var templateText = file.template

templateText = cmsTemplates.template.setAbePrecontribDefaultValueIfDoesntExist(file.template)
var templateText = cmsTemplates.template.setAbePrecontribDefaultValueIfDoesntExist(file.template)
templateText = templateText.replace(/(?!.*?tab=['|"]slug)(\{\{abe.+.*\}\})/g, '')
templateText = templateText.replace(/(\{\{abe.+)(\}\})/g, `$1 precontribTemplate="${file.name}"$2`)
precontributionTemplate.push(templateText)
Expand Down

0 comments on commit 4ddee5e

Please sign in to comment.