Skip to content

Commit

Permalink
fix elseif and elseunless condition tag mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
kethinov committed Jan 11, 2018
1 parent 5081278 commit d5f0053
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions teddy.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,10 @@
}

if (sibling.replace(/^\s+/, '').substring(0, 8) === '<elseif ') {
elseCond = matchRecursive(renderedTemplate, condString + sibling + '...</elseif>')
elseCond = matchRecursive(replaceNonRegex(renderedTemplate, condString, ''), sibling + '...</elseif>')
elseCond = elseCond ? sibling + replaceNonRegex(elseCond[0], condString, '') + '</elseif>' : null
} else if (sibling.replace(/^\s+/, '').substring(0, 12) === '<elseunless ') {
elseCond = matchRecursive(renderedTemplate, condString + sibling + '...</elseunless>')
elseCond = matchRecursive(replaceNonRegex(renderedTemplate, condString, ''), sibling + '...</elseunless>')
elseCond = elseCond ? sibling + replaceNonRegex(elseCond[0], condString, '') + '</elseunless>' : null
} else if (sibling.replace(/^\s+/, '').substring(0, 6) === '<else>') {
elseCond = matchRecursive(replaceNonRegex(renderedTemplate, condString, ''), sibling + '...</else>')
Expand Down

0 comments on commit d5f0053

Please sign in to comment.