Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow CommonMark rules for white space in code blocks #22080

Open
alya opened this issue May 17, 2022 · 1 comment
Open

Follow CommonMark rules for white space in code blocks #22080

alya opened this issue May 17, 2022 · 1 comment

Comments

@alya
Copy link
Contributor

alya commented May 17, 2022

In d671683, we stripped trailing whitespace in code blocks to address #3998. However, this is inconsistent with CommonMark, and can cause problems for the user, e.g. making diff blocks invalid.

As discussed on CZO, we should follow the CommonMark rules for processing code blocks:

Whitespace must not be stripped from a fenced code block, except from the info string on the opening fence line and up to three spaces immediately preceding the closing fence on the closing fence line.

As a follow-up, we can consider fixing #3998 by offering users the option to strip trailing whitespace before sending a message when we think it would be helpful to do so.

CZO discussion thread

@zulipbot
Copy link
Member

Hello @zulip/server-markdown members, this issue was labeled with the "area: markdown" label, so you may want to check it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants