创建< span>降价的元素(kramdown) [英] Create <span> element with markdown (kramdown)

查看:106
本文介绍了创建< span>降价的元素(kramdown)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用markdown创建span元素?我正在使用Kramdown转换器.

Is it possible to create a span element with markdown? I'm using the Kramdown converter.

谢谢!

推荐答案

根据 Markdown语法规范/文档,您应该可以使用普通的HTML <span>元素.此外, Kramdown文档完整介绍了如何使用HTML元素,以及尤其是<span>.

According to the Markdown syntax spec/documentation, you should be able to use a plain HTML <span> element. Additionally, the Kramdown documentation has an entire section on using HTML elements in general, and <span> in particular.

摘自Kramdown的文档:

From Kramdown's docs:

HTML标记不仅可以在块级上使用,而且还可以在 跨度级别.跨度级HTML标记只能在一个内部使用 块级元素,不可能在一个元素中使用开始标记 块级元素和结束标签在另一个.注意只有正确 支持XHTML!这意味着您必须使用例如而不是
(尽管kramdown会尝试在以下情况下修复此类错误: 可能).

HTML tags cannot only be used on the block-level but also on the span-level. Span-level HTML tags can only be used inside one block-level element, it is not possible to use a start tag in one block level element and the end tag in another. Note that only correct XHTML is supported! This means that you have to use, for example, instead of
(although kramdown tries to fix such errors if possible).

默认情况下,kramdown会解析跨HTML标签内的kramdown语法. 但是,可以使用parse_span_html配置此行为 选项.如果将其设置为true,则HTML span中的语法解析为 启用,如果将其设置为false,则禁用分析.也是 可以使用以下命令在每个标签的标签基础上启用/禁用语法解析 markdown属性:

By default, kramdown parses kramdown syntax inside span HTML tags. However, this behaviour can be configured with the parse_span_html option. If this is set to true, then syntax parsing in HTML spans is enabled, if it is set to false, parsing is disabled. It is also possible to enable/disable syntax parsing on a tag per tag basis using the markdown attribute:

  • 如果HTML标签具有属性markdown ="0",则在该HTML标签内不会进行任何解析(HTML span标签的解析除外).

  • If an HTML tag has an attribute markdown="0", then no parsing (except parsing of HTML span tags) is done inside that HTML tag.

如果HTML标签具有属性markdown ="1",则该标签的内容将被解析为跨度级别元素.

If an HTML tag has an attribute markdown="1", then the content of the tag is parsed as span level elements.

如果HTML标记具有属性markdown ="block",则会发出警告,因为HTML跨度不能包含块级元素,并且 该属性将被忽略.

If an HTML tag has an attribute markdown="block", then a warning is issued because HTML spans cannot contain block-level elements and the attribute is ignored.

如果HTML标记具有属性markdown ="span",则该标记的内容将被解析为跨度级别元素.

If an HTML tag has an attribute markdown="span", then the content of the tag is parsed as span level elements.

这篇关于创建&lt; span&gt;降价的元素(kramdown)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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