Adding language support to code blocks requires understanding Markdown parsing and block attributes.
The issue requests adding language support to code blocks in Gutenberg, specifically retaining language information when pasting Markdown. This involves modifying the code block to include language attributes and classes. The main blocker is the current lack of language support in the code block.
Describe the bug
When I paste markdown, I like/expect that the language specified after the start of a backtick fence will be converted into a CSS class about the language specified. So if I start the block like ```php I expect to see a <code class="language-php"> in the block. This isn't happening.
Here's a CommonMark spec/test about the behavior that matches my expectations: https://spec.commonmark.org/0.28/#example-111
To Reproduce Steps to reproduce the behavior:
```php
<?php
$random = 'what';
```
Expected behavior
That the language-php or similar is honored and applied as a class to either the internal code block (like the CommonMark spec) or even to the outer pre block.
Desktop (please complete the following information):
Additional context
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!