code-syntax-block icon indicating copy to clipboard operation
code-syntax-block copied to clipboard

Add Escaping of Content

Open mkaz opened this issue 5 years ago • 4 comments

See: https://github.com/westonruter/syntax-highlighting-code-block/pull/118

mkaz avatar Jun 23 '20 16:06 mkaz

Humm. Somehow it seems that now doing <code>{escape(attributes.content)}</code> is double-escaping the content. It's causing block validation errors now in syntax-highlighting-code-block. Is the content now getting pre-escaped somehow?

westonruter avatar Oct 19 '20 19:10 westonruter

Opened an issue to investigate: https://github.com/westonruter/syntax-highlighting-code-block/issues/201

westonruter avatar Oct 19 '20 20:10 westonruter

It appears due to https://github.com/WordPress/gutenberg/pull/24689.

westonruter avatar Oct 19 '20 20:10 westonruter

I've added what I believe is the required escaping logic in https://github.com/westonruter/syntax-highlighting-code-block/pull/200.

westonruter avatar Oct 26 '20 20:10 westonruter