Quotes containing code block must start with newline

When including a quote with a code block, it will not render correctly unless the quote starts with an extra newline character. For example, the following will display correctly:

[quote="abarker"]
Sample quote 1, without any code.
[/quote]

However, insert a code block into the quote, and things will become problemeatic.

[quote="abarker"]
Sample quote 2, with a small code block.
```
n = 2;
```
This will not work
[/quote]

Then again, if you add an extra line break to the beginning of the quote, it starts working again:

[quote="abarker"]

Sample quote 3, with a small code block.
```
n = 2;
```
This will work
[/quote]
5 个赞

If the quote only consists of code, I’ve found adding an extra line has no effect to fix formatting. But inserting two backticks before the code block, and none after it, works.

A single backtick will fix the #, but shows up in the code.

Becomes

Testing fail condition for current status:

Appears to still be an issue.

1 个赞

Status check:

<hidden comment to get around the absurdly long 20 character limit that meta.d imposes.

This one was a pain to debug. I’ve included a workaround, but this is a core markdown parser bug and it should be revisited.

PR is ready here:

3 个赞

这似乎出现了回归问题。如果引用包含代码块和一行非代码文本,代码块的格式会被保留;但如果单独引用代码块,格式则无法保留。

我在此处发布了该问题的示例:https://try.discourse.org/t/testing-issue-with-quoted-code-blocks/1401/2

2 个赞

当然,可以指派给 @eviltrout 吗?

花了一点时间才找到正确的修复位置,不过来了!

6 个赞

这里有些问题,Meta 上的表现与我开发期间看到的不一致。

1 个赞

想明白了,jQuery 骗了我。

6 个赞