George Edwards George Edwards - 3 months ago 28
HTML Question

inValid html - unexpected closing tag `</code>`

The following code snippet was generated by the

markdown renderer, and is included in my angular 2 template.

<code>
@import { url(&#39;~/platform.css&#39;) };
</code>


However, it throws the following error:

Unexpected closing tag "code" ("
<code>
@import { url(&#39;~/platform.css&#39;) };
[ERROR ->]</code>


What is wrong with that code?

Answer

I think you need to encode the content like

<code>
{{'@import { url(&#39;~/platform.css&#39;) };'}}
<code>

if it contains { or }

Comments