How to format code blocks in WordPress. The last method (the enlightner method) which is a simple plugin is by far the best method in Gutenberg WordPress .
HTML block
This is a standard HTML block. Add your own HTML (and view it right here as you edit!).
var x = 'hello'
console.log(x)
var x = 'hello'
pre formatted text
Add text that respects your spacing and tabs, and also allows styling such as bold, italics & strikethrogh text.
var x = 'hello' console.log(x)
code block
Add text that respects your spacing and tabs — perfect for displaying code.
var x = 'hello'
console.log(x)
Enlightner
This is by far the best way to format code on the web. It creates a nice little block that is pre-edited for the user.
var x = 'hello' console.log(x)
This is a table using advanced gut.
title 1 | title 2 |
hello | now this is something really long |
Thank you for following