alanshaw / grunt-include-replace

Grunt task to include files and replace variables. Allows for parameterised includes.
MIT License
200 stars 45 forks source link

Send parameters through nested includes #41

Closed dpcardoso closed 10 years ago

dpcardoso commented 10 years ago

I'm trying to send parameters through nested includes but occurs the following error when executing the task: Unexpected token J Use --force to continue.

index.html

@@include('/path/to/include/message.html', {"name": "Joe Bloggs"})

message.html

@@include('/path/to/include/message2.html', {"name": @@name})

message2.html

<p>Hello @@name!</p>
alanshaw commented 10 years ago

I'm guessing your include statement is being replaced with:

@@include('/path/to/include/message2.html', {"name": Joe Blogs})

Try surrounding with quotes:

@@include('/path/to/include/message2.html', {"name": "@@name"})