如何将Liquid标签高亮显示在有序列表中? [英] How can I put a Liquid tag highlight in an ordered list?
本文介绍了如何将Liquid标签高亮显示在有序列表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我想要的页面:
<ol>
<li>first</li>
<li>second
<code></code>
</li>
<li>third</li>
</ol>
这就是我正在写的:
1. first
2. second
{% highlight ruby %}
code here
{% endhighlight %}
3. third
这就是它的渲染方式:
<ol>
<li>first</li>
<li>second</li>
</ol>
<div class="highlight>
code here
</div>
<ol>
<li>third</li>
</ol>
那我该怎么写,它将呈现出我想要的样子?
So how do I write and it will render as what I want it to be?
推荐答案
我想出了一种方法:
1. first
2. second
: {% highlight ruby %}
code
code
code
{% endhighlight %}
3. third
尽管它呈现为定义列表(<dt>
和<dd>
标记),但这在技术上可能不正确地使用该标记,因此,如果您对这种标记过于严格,则可能不喜欢它,但是我没有在没有编写自己的插件来生成列表的情况下无法找到另一种方法,这将完全改变您编写列表的方式.
This renders as a definition list though (<dt>
and <dd>
tags) which is probably technically incorrect use of that markup so if you're super strict about that kind of thing you might not like it, but I haven't been able to find another way without writing your own plugin to generate lists which will completely change the way you write them.
这篇关于如何将Liquid标签高亮显示在有序列表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文