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

Add temporary fix for code syntax highlighting. #61

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

ndiego
Copy link
Member

@ndiego ndiego commented Apr 3, 2024

The Developer Blog uses the Code Syntax Block plugin to provide syntax highlighting to all Code blocks. This has worked great until recently, where new lines are replaced with <br> elements in the code. The plugin does not parse these <br> elements as actual line breaks, thinking they are part of the code, which results in the following:

Expected Actual
image image

As a temporary solution, this PR implements a filter for the Code block, replacing all <br> with \n.

@ndiego ndiego added the [Component] Blocks Related to blocks or block styles label Apr 3, 2024
@ndiego ndiego self-assigned this Apr 3, 2024
Copy link
Collaborator

@justintadlock justintadlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ndiego
Copy link
Member Author

ndiego commented Apr 8, 2024

@ryelle if you have a chance today, can you review this PR? It's a temporary fix but an important one for the Blog, and we have a couple of articles set to be published this week that will need the fix so the code blocks appear correctly. Let me know if you have any questions/concerns 🙏

Copy link
Contributor

@ryelle ryelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Blocks Related to blocks or block styles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants