There is a inconvenient function in Gutenberg when transfer classical html code
Describe the bug
Hello, Gutenberg team. I found Gutenberg will change my html code even if in classical blocks. And the most inconvenient part is that, it will change the [code] blocks like some functions or command of the special characters, which we do not make changes.
For instance, " will be change to ;quote, && will be changed to && which is useless for our articles, and make us put more unnecessary strength on modifying our articles, some please fix this bug!
Thank you for your reading.
To Reproduce
- Edit the page which wasn't edited by Gutenberg before.
- Just save it.
- Special characters will be change to other
Expected behavior Just transfer the code blocks to "insert code blocks" blocks but not change any words especially some command lines or function words in articles.
Screenshot

Desktop (please complete the following information):
- OS : OSX
- Browser : safari
- Version : Gutenberg 4.6.1, WordPress 4.9.8
I tested this but was not able to replicate the issue.
The steps I took were:
- Created a new post in WP 4.9.8
- Added the code displayed in the above gif between html
<code>tags. - Activated Gutenberg 4.6.1 plugin
- Opened the post editor and updated the post.
Sample code:
echo "net.core.somaxconn= 1024" > /etc/sysctl.conf
echo "vm.overcommit_memory=1" > /etc/sysctl.conf
echo never > /sys/kernel/mm/transparent_hugepage/enabled sysctl -p
Can you provide some more information so that we can replicate the issue? I'm not sure if it's relevant but it may be helpful to know:
- Do you happen to use a plugin for syntax highlighting that may have a conflict?
- Language setting of your site
Tested in Chrome 70.0.3538.110 macOS Mojave 10.14.1
Hello @starxedsteph , thank you for testing the problem for me. Sorry for not prepared more detail about this bug. I am now update my website to 5.0, also syntax highlighting released a update and I tried yesterday. I'm not sure whether Gutenberg have a conflict with syntax highlighting plugin or not.
The steps I just took were like that:
- Update to WordPress 5.0 or install Gutenberg 4.6.1 in WordPress 4.9.8
- Open a old post, which has "[code]" tag in classical editing block in article. ( And the " > " or " & " were changed when I just open the old post. )
- Click "Save" button to update the post.
And the sample code in old post was like:
[code language="bash"]
echo "net.core.somaxconn= 1024" > /etc/sysctl.conf
echo "vm.overcommit_memory=1" > /etc/sysctl.conf
echo never > /sys/kernel/mm/transparent_hugepage/enabled sysctl -p
[/code]
It tested in Sarafi 12.0.1 macOS Mojave 10.14.1 Thank you for your reading
Hi there @a2d8a4v,
Thanks for taking the time to update this issue. I cannot reproduce it with a clean install of the latest WP/Gutenberg, so this is likely related to the syntax highlighting plugin you are using. Perhaps you can report it to the plugin developers? I'm closing this issue for now but feel free to reopen it if you verify the issue is still occurring with no plugins enabled.
Looks like there's a fix here for the syntax highlighter plugin - https://github.com/Automattic/syntaxhighlighter/pull/3
Definitely seems as though this isn't a Gutenberg bug, and more an issue with that plugin, so closing is the right action.