简体   繁体   中英

why doesn't marked('#content') render well

Now I have three scripts in my html file. And there aren't any code about marked in mystyle.js.

So the question here is:

output of my html file in localhost

在此处输入图片说明

Another site render well

在此处输入图片说明

I want to know why would this happened? Thanks!

<script type="text/javascript" src="{% static 'jquery/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/mystyle.js' %}"></script>

You need to put a space between the hash and text. Marked will not render it correctly otherwise.

// prints <p>headline</p>
marked('#headline');
// prints <h1>headline</h1>
marked('# headline');

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