Skip to content

Fix syntax highlighted code blocks in lists (en) #2536

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

Merged
merged 1 commit into from
Oct 26, 2020

Conversation

stomar
Copy link
Contributor

@stomar stomar commented Oct 26, 2020

Use fenced code blocks instead of Jekyll's highlight tag.

The latter does not work in list items: the highlight tag terminates the list, so that the highlighted code is not part of the list item; subsequent list items start a new list.

Visually, this fixes wrong indentation of the code blocks, which had less indentation than the surrounding list items.

Before this fix (note the missing indentation and the strange padding below the code block):

code_blocks

Use fenced code blocks instead of Jekyll's `highlight` tag.

The latter does not work in list items: the highlight tag terminates
the list, so that the highlighted code is not part of the list item;
subsequent list items start a new list.

Visually, this fixes wrong indentation of the code blocks,
which had less indentation than the surrounding list items.
@stomar stomar requested a review from a team as a code owner October 26, 2020 20:25
@stomar
Copy link
Contributor Author

stomar commented Oct 26, 2020

Generally, GitHub style fenced code blocks should be used now (which didn't work some time ago, but now do).

@stomar stomar self-assigned this Oct 26, 2020
@stomar stomar merged commit 3f55b00 into ruby:master Oct 26, 2020
@stomar stomar deleted the fix-code-blocks branch October 26, 2020 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant