Wp-calypso: Syntax Highlighter Block rendering > as >

Created on 15 Oct 2019  ·  6Comments  ·  Source: Automattic/wp-calypso

Steps to reproduce

  1. Starting at URL:
  2. Add SyntaxHighlighter Code Block on a page/post.
  3. Add any code that contains the > character or use the below code for example:
 // injector.ts
let mocks:{[id: string] : () => any} = {}

export const injectMock = <T>(factory: () => T, mock: () => T) => {
  mocks[factory.toString()] = mock
}

export const clearMocks = () => {
  mocks = {}
}

export const mockable = <T>(factory: () => T): T => {
  if (typeof mocks[factory.toString()] !== 'undefined') {
    return mocks[factory.toString()]()
  }
  return factory()
}
  1. Save or Publish the page/post.

What I expected

> should appear as is when the page/post is previewed or viewed at the front end.

What happened instead

The > character changed to &gt; when previewed or viewed at the front end. I have tested this on a test website with Chrome 77 and macOS Catalina and was able to replicate this.

Browser / OS version

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36

Screenshot / Video

NA

Context / Source


13467026-hc
2422567-zen

[Goal] Gutenberg [Type] Bug

Most helpful comment

Fixed on WordPress.com applying this fix.
Automattic/syntaxhighlighter#3

All 6 comments

Since a fix hasn't been implemented yet, I provided the user with the workaround of converting the SyntaxHighlighter Code Block into Code Block:


_Link: https://cld.wthms.co/7NBlkg_

Recording another instance of this bug: 2455691-zen

Recording another instance of this bug: 11028813-hc → 2460256-zen

Fixed on WordPress.com applying this fix.
Automattic/syntaxhighlighter#3

Was this page helpful?
0 / 5 - 0 ratings