pelican: How to embed html and javascript in markdown

可紊 提交于 2020-06-09 10:06:10

问题


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?


回答1:


Probably the reason its not working is that you've indented your code, which means that it gets inserted as a <code> block in the HTML, according to the Markdown spec: daringfireball.net/projects/markdown/syntax#precode



来源:https://stackoverflow.com/questions/19036718/pelican-how-to-embed-html-and-javascript-in-markdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!