说到点子上了
有没有办法让 Pug 将嵌入的 HTML 作为实际 HTML 的一部分包含在 Markdown 文件中,而不仅仅是纯文本?
细节
我有一个使用jstransformer-markdown-it过滤器的 Pug 模板。输入 Markdown 文件已嵌入 HTML。那个 Markdown 文件看起来像这样 ( video.md)
# Watch this video!
This video demonstrates *the power of something something*.
<iframe width="560" height="315" src="https://www.youtube.com/..." frameborder="0" allowfullscreen></iframe>
More Markdown here.
----------------
Run Code Online (Sandbox Code Playgroud)
加载此 Markdown 文件的模板如下所示 ( entry.pug)
html
include head.pug
body
header Article
div(id="main")
article
include:markdown-it video.md
Run Code Online (Sandbox Code Playgroud)
然后像这样 ( index.js)通过 Express 提供。
const express = require('express');
const app = express();
app.set('view engine', 'pug');
app.get('/', …Run Code Online (Sandbox Code Playgroud)