Skip to content

Commit

Permalink
Escape Mustache template in JSCore article.
Browse files Browse the repository at this point in the history
  • Loading branch information
natecook1000 committed Nov 9, 2015
1 parent b0ff716 commit ad1a8d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 2015-01-19-javascriptcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ let load = context.objectForKeyedSubscript("loadPeopleFromJSON")
guard let people = load.callWithArguments([peopleJSON]).toArray() as? [Person]
else { return }

let template = "{{getFullName}}, born {{birthYear}}"
let template = "{% raw %}{{getFullName}}, born {{birthYear}}{% endraw %}"
let mustacheRender = context.objectForKeyedSubscript("Mustache").objectForKeyedSubscript("render")
for person in people {
print(mustacheRender.callWithArguments([template, person]))
Expand Down

0 comments on commit ad1a8d1

Please sign in to comment.