如何在HTML块中呈现Markdown语言? [英] How to render markdown language in html blocks?

查看:79
本文介绍了如何在HTML块中呈现Markdown语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:在降价文件中,我想生成一些更复杂的元素,例如

Background: In markdown files, I want to generate some more complex elements, such as this question I posted yesterday. So I am tried to do that by using original html/css.

问题:但是我注意到降价语言不会在html块中呈现.

Problem: But then I notice the markdown language won't be rendered in the html blocks.

我的环境设置是:

  • 编辑器:Atom
  • 降价预览/导出:降价预览增强
  • 数学渲染:Katex

然后,我将展示不适用html的markdown语言的示例.

Then, I will show examples of markdown language not applied for html.

输入:

<h4>$(\Omega, \mathcal{F}, \mathbb{P})$</h4>

$(\Omega, \mathcal{F}, \mathbb{P})$

结果是:

您可以看到html块下的相同方程式未呈现.

You can see that the same equation in under the html block is not rendered.

输入:

<div>
> ABCDEFC
> ABCDEFC
> > ABCDEFC
> ABCDEFC
</div>

> ABCDEFC
> ABCDEFC
> > ABCDEFC
> ABCDEFC

结果是:

仍然,不会呈现 markdown .

那么,如何在Markdown中的html块中呈现此数学方程式?

So, how to render this math equation in html block in Markdown?

推荐答案

这个问题实际上很简单,此答案是为可能有类似问题的任何人编写的.

This problem is actually very simple, this answer is written for anyone may have similar problem.

通常 HTML块以空白行结尾.因此,解决此问题的方法是在 HTML Markdown 之间添加空白行.

Normally HTML blocks end with a blank line. So the solution for this problem is to add a blank line between HTML and Markdown.

例如,在第一个示例中,代替了

For instance, in the first example, instead of have

<h4>$(\Omega, \mathcal{F}, \mathbb{P})$</h4>

<h4>

$(\Omega, \mathcal{F}, \mathbb{P})$

</h4>

一切都会好起来的.

类似,而不是写作

<div>
> ABCDEFC
> ABCDEFC
> > ABCDEFC
> ABCDEFC
</div>

我们应该写

<div>

> ABCDEFC
> ABCDEFC
> > ABCDEFC
> ABCDEFC

</div>

我一直在思考.希望此解决方案可以帮助有类似问题的人.

I have been overthinking. Hope this solution can help people with similar problem.

这篇关于如何在HTML块中呈现Markdown语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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