WordPress blog: Switch to new block editor from classic editor

Challenge: This post was not intended but since I faced a challenge while writing an another post today which involved code snippets. The code snippets were not getting displayed properly and it was adding some span tags in between the code. Basically the code tag used for code snippets did not work in classic editor of wordpress blog.

Solution: Blogger require to switch to new block editor. See below screenshot to switch to new block editor. If you do not see this option, then please clear cookies and cache of the browser. If you are unable to do it in your favorite browser, then please do it in firefox because it worked for me in this browser.

Click ‘Learn More’
Click ‘Try the block edior’
New editor – Block editor
Add a block
Since we want to add code snippets, we can select ‘SyntaxHighlighter Code’
Add the code snippet. Also, you can set appropriate settings in right pane. Settings like ‘Code Language’, line number highlighter etc.

Below is the example output:-

public class MyClass
{
	public string SomeProperty { get; set; }

	public string SomeMethod(string param)
	{
		return param;
	}
}

That’s all. Please let me know if you found it to be helpful in comments. Also do let me know if you have any suggestions too.