添加HTML时Jekyll不会渲染Markdown [英] Jekyll doesn't render Markdown when adding HTML

查看:91
本文介绍了添加HTML时Jekyll不会渲染Markdown的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Markdown文件中有这个Markdown代码.它具有内联HTML.

I have this markdown code in a Markdown file. It has inline HTML.

---
layout: page
title: About This Website
permalink: /about/
---


This website is built with <i class="fa fa-heart" style="color: #EEAAAA"></i>, 
[Jekyll](https://jekyllrb.com/), [LESS](http://lesscss.org/), 
[Gulp](http://gulpjs.com/), and a series of other [NPM builders](http://gulpjs.com/plugins/).
It is hosted on [Github Pages](https://pages.github.com/).

但是当我用<div>将东西包裹在最前面的东西下面时,降价不会显示.即使我用{% raw %}包裹了<div>开头和结尾的标签.

But when I wrap the stuff below the front matter with a <div>, the markdown doesn't render. Even when I wrapped the opening and closing <div> tags with {% raw %}.

为什么?有什么解决方法吗?我正在使用Jekyll 3.

Why? Are there any workarounds? I'm using Jekyll 3.

推荐答案

如果将markdown放入HTML块标记(例如div)中,则必须允许markdown转换(默认为关闭).在kramdown(Jekyll 3的默认设置)中,使用markdown ="1"属性.示例:

If you put your markdown inside an HTML block tag (e.g. div) than you have to allow markdown conversion (the default is off). In kramdown (the default for Jekyll 3) use the markdown="1" attribute. Example:

<div markdown="1">
This is a list:

- Item 1
- Item 2
- Item 3
</div>

PS:问得好.我已将您的问题添加到 Jekyll F.A.Q. 干杯.

PS: Good question. I have added your question to the Jekyll F.A.Q. Cheers.

这篇关于添加HTML时Jekyll不会渲染Markdown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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