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 إعجابات