gpt4 book ai didi

markdown - 使用 markdown (kramdown) 创建 元素

转载 作者:搜寻专家 更新时间:2023-10-31 22:32:12 30 4
gpt4 key购买 nike

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

谢谢!

最佳答案

根据Markdown syntax spec/documentation ,您应该能够使用纯 HTML <span>元素。此外,Kramdown documentation有一整节介绍一般使用 HTML 元素,以及 <span>特别是。

来自 Kramdown 的文档:

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

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

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

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

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

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

关于markdown - 使用 markdown (kramdown) 创建 <span> 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13685874/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com