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:
https://github.com/discourse/discourse/pull/3715

3개의 좋아요

이 문제는 이전 버전에 비해 퇴보한 것으로 보입니다. 코드 블록과 비코드 텍스트 한 줄이 함께 인용되면 코드 블록의 포맷이 유지됩니다. 그러나 코드 블록만 단독으로 인용되면 포맷이 유지되지 않습니다.

문제의 예시를 여기에 게시했습니다: https://try.discourse.org/t/testing-issue-with-quoted-code-blocks/1401/2.

2개의 좋아요

네, 이 작업을 @eviltrout에게 할당해 주실 수 있나요?

고칠 곳을 찾는 데 시간이 좀 걸렸지만, 드디어 해결했습니다!

6개의 좋아요

여기 뭔가 문제가 있어요. 메타에서 확인한 동작이 개발 중 본 것과 일치하지 않거든요.

1개의 좋아요

원인을 파악했어요. jQuery가 나를 속였네요.

6개의 좋아요