HTML etailseRequire在Markdown块之前空一行

如果 Markdown 的“块”语法能在 <details> 中工作,而无需空行,那就太好了。我经常在代码片段中遇到这种情况。例如,这种相当直接的语法无法按预期呈现:

<details>
```
# not code
```
</details>

<details>
```
# not code
```
</details>

虽然我最常遇到的是代码块(鉴于我们运行的是一个编程语言论坛),但它也适用于其他 Markdown“块”语法:

<details><summary>例如,标题</summary>
# not headers

This is the code for this block:
````md
<details><summary>例如,标题</summary>
# not headers

This is the code for this block:
```md
(stack overflow)
```
</details>
还有引用块 > this should be a quote, I'd expect

这是预期的吗?

2 个赞

也许可以试试这样

[details="open"]

不是代码

[/Details]
not code block
Not code

并使用方括号。

Headers

Header 1

Header 3

[details="not code block"]
# Header 1
## Header 3
[/Details]
2 个赞

是的,这不是一个错误,这是 CommonMark 规范

混合使用 HTML 和 Markdown 时,您需要额外的换行符。

这个怪物在没有换行符的情况下也能工作,但我建议只使用 @Heliosurge 建议的 BBCode。

<details>
<pre>
<code># 是的代码
</pre>
</code>
</details>
5 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.