Copy Button – Eternal Night https://www.shuijingwanwq.com There is no problem not worth solving, and no technology not worth learning! Thu, 18 Jun 2026 08:25:47 +0000 en-US hourly 1 https://wordpress.org/?v=7.0 Say goodbye to flashing and non-copyable: smooth migration from SyntaxHighlighter to Code Block Pro https://www.shuijingwanwq.com/en/2026/06/18/17337/ https://www.shuijingwanwq.com/en/2026/06/18/17337/#respond Thu, 18 Jun 2026 08:16:58 +0000 https://www.shuijingwanwq.com/?p=17337 Post Views: 3

As a technical blogger, the quality of the code presentation directly affects the reader’s reading experience. I have been using SyntaxHighlighter Evolved The plugin, but as the requirements for the user experience improve, I gradually found several pain points of it. After repeated attempts and comparisons, I finally chose code block pro.

Below is my complete migration process and test report.


1. Why give up patching on SyntaxHighlighter?

My original idea is very simple: since SyntaxHighlighter Evolved is easy to use, then add CSS and JS on the basis of it, and manually implement the function of language identification and copy buttons.

However, after many attempts, I gave up.

There are three reasons:

  1. DOM complex structureThe HTML structure of SyntaxHighlighter after rendering is very deep, and the CSS selector is difficult to accurately hit the target position
  2. JS conflict risk is high: After adding custom JS, it is easy to conflict with the plugin’s own script, resulting in highlight failure
  3. High maintenance cost: Custom code may be overwritten or invalid every time the plugin is updated

The final conclusion is:Instead of tinkering, it is better to directly replace a plug-in that supports these functions directly.


2. Two core pain points of SyntaxHighlighter Evolved

Before deciding to replace, I sorted out the two most unbearable questions for syntaxhighlighter evolved (the WordPress version when I tested was 7.0):

Pain Point 1: No Language Identification and Copy Buttons

This is the most basic functional requirement. Readers need to know what language the code is, and also need to copy the code with one click.

Figure 1: SyntaxHighlighter Evolved rendered code block, no language identifier, no copy button

Figure 1: Missing language identification and copy button

As can be seen from the above figure, the top of the code block is empty, there is no prompt information, and there is no copy button.

Pain point 2: Front-end rendering causes page flicker

This is a more serious problem at the technical level. SyntaxHighlighter Evolved uses front-end JavaScript rendering (based on Highlight.js), and the process is as follows:

  1. Browser loading page → code is displayed in plain text
  2. Load js file → parse code
  3. Apply highlight styles → code to color

In this process, the reader will see the flashing process of the code suddenly ‘change’ from ‘plain text’ to color, which greatly affects the first impression.

Figure 2: The plain text is displayed first when the page is loaded, and then it becomes colored after flashing.

Figure 2: Blinking problems caused by front-end rendering

3. Why did you choose Code Block Pro in the end?

When researching alternatives, I focused on several dimensions: rendering, language support, topic abundance, and most importantly, compatibility with older articles.

code block pro In the end, the reason is as follows:

Compare the dimensionSyntaxHighlighter Evolvedcode block pro
renderingFrontend js rendering (with flicker)Server-side rendering (no flicker)
language identifier❌ Not supported✅ Support
Copy button❌ Not supported✅ Support
highlight enginehighlight.jsvs code same engine
language supportabout 30140+ kinds
ThemeA small number of fixed styles25+, with Light Plus, Dark Plus, etc.

Why choose the Light Plus theme?

You may have noticed that I finally chose Light Plus theme (white background).

The reason is very simple: I found the code example generated by the current mainstream AI programming assistants (such as ChatGPT, Claude, Copilot, etc.),Light themes that use almost all of them on a white background.

This has become an industry default display habit:

  • White background in bright color mode to read more clearly
  • The code screenshots generated by AI are mostly light-colored themes
  • Most technical documentation and blogs also use light code backgrounds

So, in order to keep the code samples in the blog consistent with the code style generated by the AI, I chose the Light Plus theme.


4. Installation and testing process

4.1 Install Code Block Pro

Search and install Code Block Pro in the WordPress background.

Figure 3: Search Code Block Pro and install in the plugin market

Figure 3: Search results and installation interface

Click ‘Install Now’ and enable it.

4.2 Configuration code blocks

Add the Code Pro block to the Gutenberg editor, paste the Go language test code, and the right panel can be configured in detail.

Figure 4: Code Block Pro Settings Panel and Live Preview

Figure 4: Select language Go, theme Light Plus, enable line number

Key configuration items:

  • Spoken language: Select Go (support 140+ languages)
  • Theme: Select Light Plus (white background, consistent with AI generation style)
  • line number: Enabled, the start number is set to 1
  • highlight: You can highlight specific lines of code on demand

4.3 Compatibility test: Can the old and new plug-ins coexist?

This is my most worried about. If Code Block Pro conflicts with SyntaxHighlighter Evolved, all old articles will be affected.

I insert two code blocks at the same time in the same article:

  • An use code block pro(via Gutenberg code pro block insert)
  • An use SyntaxHighlighter Evolved(through SyntaxHighlighter Code block insert)

The test results are as follows:

As shown in Figure 5: The old and new plugins coexist independently in the same article without interfering with each other

Figure 5: Compatibility test passed

The conclusion is very clear:The two coexist perfectly.

  • Code Block Pro only handles code inserted through the Code Pro block
  • SyntaxHighlighter Evolved continues processing old code inserted through the SyntaxHighlighter code block
  • The CSS and JS of the two are not contaminated with each other, and each is independently rendered

5. Migration strategy: step-by-step replacement, no need to modify at one time

Based on the above compatibility test, I have formulated the following migration strategies:

Option 1: Gradually Migration (Recommended)

For old articles, the code block that uses syntaxhighlighter evolved is temporarily reserved, and no modifications are made. All new articles use Code Block Pro.

Benefits of this:

  • Zero risk, no need to modify historical articles in batches
  • Use the most suitable plugins for the old and new articles
  • Over time, the proportion of old articles has naturally decreased

Option 2: Keep old articles, use new plugins for new articles

If you are like me, there are a lot of historical articles, this program is the most practical.

If you have installed and enabled Code Block Pro, then the Code Pro block should be able to display the Code Pro block normally in the default block editor of the WordPress version 7.0. You just need to insert it in a new article.


6. Summary of the final experience

After a complete test and comparison, I summarize the core experience of the two plugins as follows:

Experience DimensionsSyntaxHighlighter Evolvedcode block pro
loading speed⭐ ⭐ With flicker delay⭐⭐⭐⭐ Display immediately
highlight effect⭐⭐ Traditional style⭐⭐⭐⭐ vs code level
language support⭐ About 30 species⭐⭐⭐⭐ 140+
language identifier
Copy button
Topic richness⭐⭐⭐⭐⭐⭐ 25+
Compatible with old articles✅ Perfect coexistence

7. Conclusion

If you are also a user of SyntaxHighlighter Evolved, you are beingflickering problemAndMissing language ID/copy buttonTroubled, I strongly recommend that you try code block pro.

It not only solves all the pain points above, but also allows you to get a code reading experience similar to VS Code in WordPress. And, since it coexists perfectly with the old plugin, you canMigrate step by step at zero risk, without the need to modify all historical articles at once.

Hope this test report will help you. If you have any questions, please share and discuss in the comment area!

]]>
https://www.shuijingwanwq.com/en/2026/06/18/17337/feed/ 0