Move HTML template array concatenation into its own function.
This commit is contained in:
parent
b2659b91dd
commit
9836d5ad07
@ -50,7 +50,7 @@ module.exports = (grunt) ->
|
||||
parts.push switch part[1]
|
||||
when '$' then "E(`#{part[2]}`)"
|
||||
when '&' then "`#{part[2]}`.innerHTML"
|
||||
when '@' then "`#{part[2]}`.map((x) -> x.innerHTML).join('')"
|
||||
when '@' then "E.cat(`#{part[2]}`)"
|
||||
when '?'
|
||||
args = ['""', '""']
|
||||
for i in [0...2]
|
||||
|
||||
@ -14,3 +14,8 @@ E = do ->
|
||||
fn = (x) ->
|
||||
str[x]
|
||||
(text) -> r.call text, regex, fn
|
||||
|
||||
E.cat = (templates) ->
|
||||
html = ''
|
||||
html += x.innerHTML for x in templates
|
||||
html
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user