简体   繁体   中英

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

The following code snippet was generated by the marked 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?

I think you need to encode the content like

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

if it contains { or }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM