Skip to main content
Agency Program Get 2× more leads and save 50% on hosting. Built for agencies ready to grow. Book a call
CSB

Code Syntax Block

v3.2.1
by Marcus Kazmierczak · 4.9 (48 reviews)

Code Syntax Block plugin extends the block editor by adding syntax highlighting to the core code block.

8K+ active installs Updated May 08, 2024 Tested to 6.5.5 Requires PHP 5.6
Try Demo Download
Pre-installed Ready in ~10s No card

About Code Syntax Block

Code Syntax Block is a WordPress plugin that adds syntax highlighting support to the core code block. It uses the Prism syntax highlighter to parse code blocks and apply syntax markup with customizable colors and styles. The plugin is developed and issues are tracked on Github.

Changelog

= 3.2.1

  • Update CSS to reduce specificity, enabling theme.json to override.
    Props to @anlino

= 3.2.0

  • Fix issue with content attributes preserving white space
    Thanks to @chandan-tudu

= 3.1.1

  • Fix trailing comma error, PHP 7

= 3.1.0

  • Add plugin settings page
  • Move global scheme setting to settings
  • Move default language to settings
  • Ugrade Prism to v1.28.0

= 3.0.0

  • Remove support pre WP 5.6
  • Editor view: Show dark background
  • Editor view: Show labels above code block
  • Publish view: Fix line number alignment
  • Publish view: Remove border from code Twentytwentytwo
  • Chore: Update dependencies

= 2.2.0

  • Upgrade Prism to v1.25.0

2.1.1

  • Fix undefined index error with $tag[‘code’] not defined
    on archive page triggered by Beaver Builder

2.1.0

  • Fix background color not being applied unless language specified.
  • Fixes issues with white text on light background.
  • Applies color syntax to all code blocks, language not required

2.0.4

  • Fix pasting plain text stripping elements
  • Removing formating tools that did not work

2.0.3

Compatibility fixes with TwentyTwentyOne theme
– Fixes default text when dark mode enabled
– Fixes linenumbers

2.0.2

Update package dependencies

2.0.1

Fix alignment with Twenty Twenty theme

2.0.0

Upgrade Prism to 1.22
Add Color Scheme options
Fix for WP 5.6 / GB 9.2

1.3.6

Update Prism language components
Adds new language support

1.3.5

Add Rust to default language list
Fix CSS issue with title
Upgrade Prism to 1.21

1.3.4

Fix setting default language using filter.

1.3.3

Fix block validation error for user roles with restricted permissions.

1.3.2

Fix issue with PHP warning when no posts

1.3.1

Fix compatibility issue with Gutenberg plugin 7.9
Removes in editor syntax preview added in 1.3.0

1.3.0

Upgrade Prism to 1.19
Add syntax preview in editor

1.2.4

Add filter to force loading assets, regardless of has_block

1.2.3

Conditionally load asset if has_blocks
Move Hack to front of default font list
Remove !important from font declaration
Change default font size to 15px for usability

1.2.2

Fix alignment issue with TwentyTwenty

1.2.1

Add Java and Kotlin to default language list

1.2.0

Upgrade Prism to 1.17.1

1.1.0

Add filters for customizing language list, and default language.

See full Release Notes on Github releases page

Try other plugins

Classic Editor icon

Classic Editor

4.9 · 9M+ installs

Enables the previous "classic" editor and the old-style Edit Post screen with TinyMCE, Meta Boxes, etc. Supports all…

WordPress Importer icon

WordPress Importer

3.1 · 3M+ installs

Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file.

Classic Widgets icon

Classic Widgets

4.9 · 2M+ installs

Enables the previous "classic" widgets settings screens in Appearance - Widgets and the Customizer. Disables the block editor…