Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
153021 stories
·
33 followers

Introducing the Enhanced Code Block: Syntax Highlighting and More

1 Share

Last year, WordPress.com introduced new code editors for the block editor and the Additional CSS input box in the WordPress admin. This was the first stage of a larger effort to make editing code a more enjoyable experience.

Today, I’m happy to announce the launch of the second stage of that effort: introducing the new and improved Code block.

This is not a new block. It’s an enhancement to the current Code block that you’ve likely already been using, which includes several improvements over the original:

  • Syntax highlighting: Supports color-based syntax highlighting for over 100 common languages.
  • Configuration: Decide to show the filename, language name, line numbers, and even include a copy button for visitors.
  • Drag-and-drop: Dragging a code file from your computer to the editor will automatically transform it to the Code block with the language set.
  • Transforms: Transform other code-supported blocks on WordPress.com, such as Syntax Highlighter, to the new Code block.
  • Styles: Customize syntax colors directly from the editor or via ‘theme.json’ if you’re a developer.

Using the enhanced Code block

You do not have to enable anything to begin using the new version of the Code block. It’s already available to use. Just insert the Code block anywhere in the block editor and add your code.

By default, when adding a Code block and inserting code, you will see your code in Plain Text:

Example of code displayed in a blog post using plain text formatting.

Of course, Plain Text doesn’t include any syntax highlighting since it’s not a language. To change this, choose a code language from the Settings → Language dropdown in the sidebar:

Example of the Code block displaying code using a language preset.

Syntax highlighting will then be applied based on the language that you selected, making the code much more readable for both you and your visitors!

Pro tip: If you type three backticks followed by the language name (e.g., ```php) and then hit Enter, the editor will automatically create a new Code block instance and auto-fill the Language setting.

If you want to kick your Code block’s features up a notch, you can also configure several other settings besides the language:

  • Filename: Add a custom filename to display in the top left of the code block (useful when walking readers through tutorials).
  • Show language name: Displays the language name in the top right corner of the block.
  • Show copy button: Inserts a Copy button in the top right of the block, allowing site visitors to copy the entirety of the code.
  • Show line numbers: Displays line numbers next to your code on the left.
  • Line numbers start at: Choose a starting line number.

This will make your site’s code examples much more reader friendly:

Example of the Code block displaying code using the additional language settings.

Customizing the Code block colors

There are multiple ways to customize the syntax highlighting and colors shown with the enhanced Code block. In this section, I’ll walk you through each from the quickest/simplest to the more advanced techniques.

Selecting a block style

The Code block ships with four block styles out of the box:

  • Default: Will use the default styles and colors from your theme.
  • No Highlight: Disables syntax highlighting.
  • Solarized Light: A light color scheme.
  • Solarized Dark: A dark color scheme.

Themes can also register additional styles. Selecting one of these styles is the quickest way to change how your Code block is output:

Customizing colors from the editor

You can also customize the colors directly from the editor via the Styles → Color panel in the block sidebar. The block has an extensive array of color options for customizing every aspect of the syntax highlighting:

Selecting custom colors for the Code Block syntax formatting.

You are not limited to only colors either. You can customize any of the other available styles, such as Typography, Border, and more. These options haven’t changed with the latest enhancement.

Customizing the Code block via theme.json

If you’re a developer or theme author, you’ll most likely want to define default syntax colors and other styles for the default output of the block. theme.json support is included with this batch of enhancements.

Here’s what my custom Code block styles look like after a few tweaks in theme.json:

Example of the Code Block using custom colors.

Because the WordPress software itself doesn’t support custom colors via theme.json, the developers at WordPress.com built in custom support for this feature.

You can customize any of the syntax colors via settings.custom.core/code in theme.json. This is an object where each key is the syntax color name and the value is the color itself.

Here’s an example snippet that you can use to customize your own colors:

{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"settings": {
"custom": {
"core/code": {
"comment": "#94a3b8",
"keyword": "#8b5cf6",
"boolean": "#f59e0b",
"literal": "#10b981",
"string": "#06b6d4",
"specialString": "#ec4899",
"macroName": "#8b5cf6",
"variableDefinition": "#3b82f6",
"typeName": "#14b8a6",
"className": "#f97316",
"invalid": "#ef4444"
}
}
}
}

Any valid CSS color is supported, so you’re not limited to hex color codes. Use CSS custom properties, RGBA, and more.

If you want to borrow my full theme.json customizations, copy and paste the following code. It includes additional custom styles to make the Code block even nicer:

{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"settings": {
"custom": {
"core/code": {
"comment": "#94a3b8",
"keyword": "#8b5cf6",
"boolean": "#f59e0b",
"literal": "#10b981",
"string": "#06b6d4",
"specialString": "#ec4899",
"macroName": "#8b5cf6",
"variableDefinition": "#3b82f6",
"typeName": "#14b8a6",
"className": "#f97316",
"invalid": "#ef4444"
}
}
},
"styles": {
"blocks": {
"core/code": {
"border": {
"color": "#e2e8f0",
"style": "solid",
"width": "1px",
"radius": "8px"
},
"color": {
"background": "#f1f5f9",
"text": "#1e293b"
},
"typography": {
"fontSize": "15px"
}
}
}
}
}

Start sharing code now.

Whether you’re publishing snippets or full-blown tutorials, the enhanced Code block makes sharing and styling code in WordPress.com smoother and more customizable than ever before. 

Syntax highlighting, block styles, and custom color options put you in full control of how your code appears. 

With these improvements, you can focus less on formatting and more on writing great content that helps your readers learn and build.





Read the whole story
alvinashcraft
54 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Node.js 25.4.0 (Current)

1 Share
Read the whole story
alvinashcraft
55 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

TeamCity 2025.11.2 Is Now Available

1 Share

The second bug-fix update for TeamCity On-Premises 2025.11 is ready to be installed! In this update, we have addressed a number of issues, such as:

  • The “buildagent” user in TeamCity Linux agent images changed its UID from 1000 to 1001;
  • Dark theme inconsistencies in the Custom Run dialog;
  • Builds with artifact dependencies may get stuck in the “Preparing to start” phase;
  • The Agent Open Terminal button may disappear from the agent details page.

All TeamCity bug-fix updates include performance and security improvements, so we recommend that you never skip these minor updates. See TeamCity 2025.11.2 Release Notes for the complete list of resolved issues.

Why update?

Staying up to date with minor releases ensures your TeamCity instance benefits from the following:

  • Performance improvements.
  • Better compatibility with integrations.
  • Faster, more stable builds.
  • Enhanced security for your workflows.

Compatibility

TeamCity 2025.11.2 shares the same data format as all 2025.11.x releases. You can upgrade or downgrade within this series without the need for backup and restoration.

How to upgrade

  1. Use the automatic update feature in your current TeamCity version.
  2. Download the latest version directly from the JetBrains website.
  3. Pull the updated TeamCity Docker image.

Need help?

Thank you for reporting issues and providing feedback! If you have questions or run into any problems, please let us know via the TeamCity Forum or Issue Tracker.

Happy building!

Read the whole story
alvinashcraft
55 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

bit Obscene: SQL Server 2025 IQP Features

1 Share

bit Obscene: SQL Server 2025 IQP Features


Going Further


If this is the kind of SQL Server stuff you love learning about, you’ll love my training. I’m offering a 25% discount to my blog readers if you click from here. I’m also available for consulting if you just don’t have time for that, and need to solve database performance problems quickly. You can also get a quick, low cost health check with no phone time required.

The post bit Obscene: SQL Server 2025 IQP Features appeared first on Darling Data.

Read the whole story
alvinashcraft
55 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

EP259 Why DeepMind Built a Security LLM Sec-Gemini and How It Beats the Generalists

1 Share

Guest:

Topics: 

  • What is Sec-Gemini, why are we building it?
  • How does DeepMind decide when to create something like Sec-Gemini? 
  • What motivates a decision to focus on something like this vs anything else we might build as a dedicated set of regular Gemini capabilities? 
  • What is Sec-Gemini good at? How do we know it's good at those things? 
  • Where and how is it better than a general LLM?
  • Are we using Sec-Gemini internally?

 Resources:





Download audio: https://traffic.libsyn.com/secure/cloudsecuritypodcast/EP259_not256_CloudSecPodcast.mp3?dest-id=2641814
Read the whole story
alvinashcraft
57 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Valve Has 'Significantly' Rewritten Steam's Rules For How Developers Must Disclose AI Use

1 Share
Valve has substantially overhauled its guidelines for how game developers must disclose the use of generative AI on Steam, making explicit that tools like code assistants and other development aids do not fall under the disclosure requirement. The updated rules clarify that Valve's focus is not on "efficiency gains through the use of AI-powered dev tools." Developers must still disclose two specific categories: AI used to generate in-game content, store page assets, or marketing materials, and AI that creates content like images, audio, or text during gameplay itself. Steam has required AI disclosures since 2024, and an analysis from July 2025 found nearly 8,000 titles released in the first half of that year had disclosed generative AI use, compared to roughly 1,000 for all of 2024. The disclosures remain voluntary, so actual usage is likely higher.

Read more of this story at Slashdot.

Read the whole story
alvinashcraft
2 hours ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories