简体   繁体   中英

pelican: How to embed html and javascript in markdown

I want to embed a few html elements and javascript in a blog post. This is my markdown file.

Title: Foo
Tags: Bar

Some Content here 

        <div id="foo">
        </div>

        <script type="text/javascript" src="static/js/bar.js"> </script>

But pelican is wrapping the html tags in a pre . So the code is not getting executed.

I'm using the Markdown library installed from pip install Markdown , version 2.3.1

I checked the docs , but to no avail.

How to avoid this from happening, either through markdown or in a pelican setting?

可能它不起作用的原因是你缩进了你的代码,这意味着它根据Markdown规范在HTML中作为<code>块插入: daringfireball.net/projects/markdown/syntax#precode

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