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

[UB] Clarify handling of whitespace in verbatim formatting #44

Open
mhatzl opened this issue Aug 21, 2023 · 1 comment
Open

[UB] Clarify handling of whitespace in verbatim formatting #44

mhatzl opened this issue Aug 21, 2023 · 1 comment

Comments

@mhatzl
Copy link
Contributor

mhatzl commented Aug 21, 2023

The spec does not describe how whitespace must be handled in verbatim formatting.
Outside verbatim context, non escaped whitespaces are combined to one space. Even new lines are combined.

For verbatim formatting, this is not the intended behaviour.
Here, all non line-breaking whitespace should be kept as is.

Line-breaking whitespace should be turned into one space.
Otherwise multiline verbatim formatting would always result in multiline output, because it is not possible to unescape a new line.
If a new line is wanted in verbatim formatting, there is still the option to escape it using a backslash.

@mhatzl
Copy link
Contributor Author

mhatzl commented Aug 26, 2023

For information:

GitHub follows the commonmark spec (https://spec.commonmark.org/0.30/#inlines), where <code> tags are used for inline verbatim, but <pre><code> for verbatim blocks. To still preserve non line-breaking whitespace in inline verbatim, they recommend adding CSS code{white-space: pre-wrap;}.

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

No branches or pull requests

1 participant