Quotation marks needed for strings inside the <p> tags of the handlebars section in script session of html?

Hello guys,

I am on the section of handlebars,
in the 5/9 exercise, we are instructed to use quotation marks with strings:
Link1
Great, now you’ve started on your else section, but you need to include some code. Add into your else section a <p> element that contains the text (with quotation marks): "There's no right way to say GIF!"

While in latter section, the demonstration shows with no quotation marks:
link2
Below is an example of the Handlebars {{each}} block:
{{#each someArray}}

{{this}} is the current element!

{{/each}}

Therefore, I am wondering if we need to use quotation marks for strings, which in the

tags of the handlebars section in script session of html?

Thanks!

The <p> tag with the text you inserted is pure HTML. Therefore the rules for HTML apply. And these are that you do not have to wrap a text node in quotation marks.
The reason why you should add quotation marks in the first example is a semantic one, it is not due to syntax rules. For some reason they wanted it to be displayed as a quote. You probably noticed that in the first example the quote marks are visible in the rendered HTML and in the other they aren’t.

Thanks a lot for your clear explanation.
I understand it now :blush:

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.