WordPress.org

Making WordPress.org

Opened 2 years ago

Last modified 3 months ago

#3743 new defect

On Make WP blog the 'Follow' action removes syntax highlighting on code snippets

Reported by: garrett-eclipse Owned by:
Milestone: Priority: normal
Component: Make (Get Involved) / P2 Keywords: has-screenshots close
Cc:

Description

Hello,

Just noticed this when I went to follow a post on make.wp.org, but if the post contains a code snippet with syntax highlighting that vanished once you click the follow button, either to follow or unfollow doesn't matter.
Example page - https://make.wordpress.org/core/2018/08/02/try-gutenberg-callout-in-wordpress-4-9-8/

Cheers

Attachments (2)

Screen Shot 2018-08-03 at 9.04.52 AM.png (513.8 KB) - added by garrett-eclipse 2 years ago.
Code Snippet w/ Highlighting
Screen Shot 2018-08-03 at 9.04.58 AM.png (507.3 KB) - added by garrett-eclipse 2 years ago.
After 'Follow' code lost syntax highlighting

Download all attachments as: .zip

Change History (3)

@garrett-eclipse
2 years ago

Code Snippet w/ Highlighting

@garrett-eclipse
2 years ago

After 'Follow' code lost syntax highlighting

#1 @dd32
3 months ago

  • Keywords close added

This occurs due to how O2 works - it tends to remove/replace large parts of the HTML with the same HTML, unfortunately the Syntax highlighting plugin needs to be executed upon each refresh of the content.

This is either a bug in O2, or Syntax Highlighter and not going to be fixed via Meta Trac. It looks like it's probably an O2 thing, as O2 references SyntaxHighlighter but not the other way around.. but maybe Syntax highlighter should be listening to a O2 JS hook..

Note: See TracTickets for help on using tickets.