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.
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.