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_

Thanks Denys!

On Sat, 19 Oct, 2019, 4:11 PM Denys Zaikin, notifications@github.com
wrote:

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

https://camo.githubusercontent.com/e3fc6ecaf9943bebd25dad04cf42838d39aa6518/68747470733a2f2f636c642e7774686d732e636f2f374e426c6b672b
Link: https://cld.wthms.co/7NBlkg https://cld.wthms.co/7NBlkg

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Automattic/wp-calypso/issues/36778?email_source=notifications&email_token=ALWKRPVJME3ZBMVNKRKLXATQPLP5BA5CNFSM4JA4Q4L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBXLMIY#issuecomment-544126499,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALWKRPSXYHNO6JXFBRT3L5DQPLP5BANCNFSM4JA4Q4LQ
.

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