Fix code block language related issues
What does this MR do and why?
Code blocks with undefined/unknown language get labeled plaintext after saving in Content Editor. This commit fixes the issue.
Related to #350364 (closed) and #358393 (closed)
Screenshots or screen recordings
Before | After |
---|---|
Screen_Recording_2022-06-14_at_11.39.20_AM | Screen_Recording_2022-06-14_at_11.38.54_AM |
How to set up and validate locally
-
Create a new wiki page or edit an existing one.
-
Enter the following code:
``` plaintext ``` ```foobar custom_language = >> this << ```
Notice that the first block doesn't have a language defined and the second one has a custom language (
foobar
) defined. -
Click "Edit rich text" to switch to content editor.
-
Click "Edit source" to switch back to the markdown editor.
-
The code should look exactly the same as what you started with.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Himanshu Kapoor