Automattic / Automattic/syntaxhighlighter

Upgrading to WordPress 5 breaks shortcodes

Open
#151 3 comments 1 reaction 0 assignees View on GitHub
[Pri] Normal [Type] Bug
Dominant language
CSS
Stars
251
Forks
81
PR merge metrics
No merged PRs in 30d

Description

Using Wordpress 4.9.10 and SyntaxHighlighter Evolved 3.5.4, I created a page, and put the following content into the Text editor:
```
[php]

[/php]

[xml]

[/xml]
```

When published, it displays with the correct highlighting and indentation:
![image](https://user-images.githubusercontent.com/542988/84430394-7ad39f00-abde-11ea-9ca0-7598daf5da14.png)

(I know I'm correct to not HTML-encode this content in the editor, because if I do, it displays incorrectly when published.)

Then I upgraded to WordPress 5.4.2. After the upgrade, the page initially displays correctly.

However, when I try to edit it, it adds an extra layer of HTML-encoding to the content. When I go to Edit Page, it opens as a Classic block, and looks like this:
![image](https://user-images.githubusercontent.com/542988/84430974-5e843200-abdf-11ea-9bdd-9f60a6d527ac.png)

And when published, it looks like this:
![image](https://user-images.githubusercontent.com/542988/84431004-6c39b780-abdf-11ea-8c0c-892321bc3427.png)

What's worse, every time I **CLICK** inside the block editor and then click outside it, it adds another layer of HTML encoding:
![image](https://user-images.githubusercontent.com/542988/84430374-75765480-abde-11ea-858f-d3c8d189e937.png)

And when published, it looks like this:
![image](https://user-images.githubusercontent.com/542988/84431137-a6a35480-abdf-11ea-98a3-a5db643817c8.png)

Is there any way to salvage this content when upgrading?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.