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

inline code spans should line wrap on whitespace breaks. #16

Open
vassudanagunta opened this issue Jan 14, 2023 · 1 comment · May be fixed by #17
Open

inline code spans should line wrap on whitespace breaks. #16

vassudanagunta opened this issue Jan 14, 2023 · 1 comment · May be fixed by #17
Labels

Comments

@vassudanagunta
Copy link

babelmark3 applies white-space: nowrap to both code blocks and inline code spans. The latter is very unconventional if not misleading. The default styles for HTML4 (W3C spec), HTML5 (W3C spec), Gecko / Firefox, Webkit / Safari and Blink / Chrome do not set the white-space property for code (so it should wrap on white space like other elements). They only set white-space: pre on pre elements, which is used for block code rendering, not inline code spans.

If you concur, I am happy to submit a PR.

For example, the following Markdown

`This very long inline code span should wrap to
new lines when it overflows its container. It
should not be styled the same as code blocks.`

renders on babelmark3 as:

Screen Shot 2023-01-14 at 2 31 48 AM

Compare to CommonMark demo:

Screen Shot 2023-01-14 at 2 31 01 AM

and to GitHub.com:

Screen Shot 2023-01-14 at 2 34 15 AM

@xoofx
Copy link
Member

xoofx commented Jan 14, 2023

Yep, sure, feel free to submit a small PR, thanks!

@xoofx xoofx added the bug label Jan 14, 2023
vassudanagunta added a commit to vassudanagunta/babelmark.github.io that referenced this issue Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants