Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right angle brackets ('>') get transformed into html entities ('>') #108

Open
haster opened this issue May 7, 2019 · 1 comment

Comments

@haster
Copy link

@haster haster commented May 7, 2019

(Note: I realise that @Viper007Bond has unfortunately passed away. I register this issue here in the hope that someone will take over and look into this and in the hope I can help someone else with the workaround I found.)

WordPress: 5.1.1
SyntaxHighlighter-Evolved: 3.5.0

When I insert SyntaxHighlighter code blocks containing right angle brackets (for instance, xml) and preview /publish the page using a user with role "Author" or below those brackets get tranformed into their HTML-entities and this breaks the syntax highlighting.

For instance, this code:
screenshot_wp_syntaxhiglight_code

gets published as this:
screenshot_wp_syntaxhiglight_wrong

Workaround: if I preview/publish using an account with role "Editor" or "Admin" everything works as expected and I get:
screenshot_wp_syntaxhiglight_right

@DannyCooper

This comment has been minimized.

Copy link

@DannyCooper DannyCooper commented May 14, 2019

Hi @haster,

Another workaround I found was to add this code to line 518 of syntaxhighlighter.php.

$code = htmlspecialchars_decode( $code );

Note: this is one possible workaround, I take no responsibility for your implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.