鹈鹕:如何在markdown中嵌入html和javascript [英] pelican: How to embed html and javascript in markdown

查看:272
本文介绍了鹈鹕:如何在markdown中嵌入html和javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在博客文章中嵌入一些html元素和javascript.这是我的降价文件.

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>

但是鹈鹕将html标签包装在pre中.因此代码不会得到执行.

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

我正在使用从pip install Markdown版本2.3.1

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?

推荐答案

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

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

这篇关于鹈鹕:如何在markdown中嵌入html和javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆