admin管理员组

文章数量:1026989

Using Handlebar/Mustache, I would like to show the Address as follows (with the new lines):

{{FirstName}}{{LastName}}
{{Address1}}{{Address2}}
{{City}}
{{State}}
{{Zip}}

But the above is always rendered in one line. I tried using \n but it doesn't work. Is it possible to handle new line (\n) in the template?

Using Handlebar/Mustache, I would like to show the Address as follows (with the new lines):

{{FirstName}}{{LastName}}
{{Address1}}{{Address2}}
{{City}}
{{State}}
{{Zip}}

But the above is always rendered in one line. I tried using \n but it doesn't work. Is it possible to handle new line (\n) in the template?

Share Improve this question asked Oct 19, 2012 at 14:52 dotNetNewbiedotNetNewbie 7994 gold badges17 silver badges35 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

Add HTML line breaks to your template:

{{FirstName}}{{LastName}}<br/>
{{Address1}}{{Address2}}<br/>
{{City}}<br/>
{{State}}<br/>
{{Zip}}

Using Handlebar/Mustache, I would like to show the Address as follows (with the new lines):

{{FirstName}}{{LastName}}
{{Address1}}{{Address2}}
{{City}}
{{State}}
{{Zip}}

But the above is always rendered in one line. I tried using \n but it doesn't work. Is it possible to handle new line (\n) in the template?

Using Handlebar/Mustache, I would like to show the Address as follows (with the new lines):

{{FirstName}}{{LastName}}
{{Address1}}{{Address2}}
{{City}}
{{State}}
{{Zip}}

But the above is always rendered in one line. I tried using \n but it doesn't work. Is it possible to handle new line (\n) in the template?

Share Improve this question asked Oct 19, 2012 at 14:52 dotNetNewbiedotNetNewbie 7994 gold badges17 silver badges35 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

Add HTML line breaks to your template:

{{FirstName}}{{LastName}}<br/>
{{Address1}}{{Address2}}<br/>
{{City}}<br/>
{{State}}<br/>
{{Zip}}

本文标签: javascriptNew line in handlebar templatesStack Overflow