WordPress / Learn

WordPress.org Learn - The canonical source for the code and content behind https://learn.WordPress.org
267 stars 95 forks source link

Code formatting on HTML and CSS code #2646

Closed jonathanbossenger closed 2 months ago

jonathanbossenger commented 3 months ago

When adding code snippets using the Code block and setting the language setting to either HTML or CSS, even if they are correctly formatted in the code block, they appear in one line on the front end.

Example lesson: https://learn.wordpress.org/lesson/css/

This happens in both the current theme and the new theme.

learn wordpress org_lesson_css_

jonathanbossenger commented 3 months ago

@StevenDufresne would you have a moment to check on what could cause this?

I'm guessing it's something that needs to be fixed upstream on the WordPress.org codebase, but not sure where to start looking

StevenDufresne commented 2 months ago

It has something to do with how you pasted it. I moved it over to my code editor, copied and repasted and everything seems to be working as it should.

StevenDufresne commented 2 months ago

Since there's a simple fix, I've closed this ticket but if it's related to an automated process or something similar, I can investigate further. Does that work?

jonathanbossenger commented 2 months ago

Ooo interesting, thanks @StevenDufresne I didn't even think of that.

I paste from Markdown into the Block editor, so it might be something related to how my Markdown is configured.

I'll watch for this in the future to figure out if I'm doing it wrong.