Closed GaryJones closed 1 month ago
@GaryJones I guess I never noticed that before! This approach seems to strip the <code>
tags out, though:
I poked around in the Gutenberg source and something like this might work:
const copyPasteHtml = createInterpolateElement(
__( 'Copy and paste into <code>composer.json</code>', 'satispress' ),
{ code: createElement( 'code' ) }
);
Now updated:
The combination of the tagged template literal, and
sprintf()
in a placeholder, means that the<code>
tags around thecomposer.json
file name are visible in the release actions:While the most straightforward and sensible thing to do would be to just remove the tags /
sprintf()
, I tried to see if I could unescape them. There may be a simpler way than this messy and non-performant hack, that I stole from here.It works though:
This is the only instance in the code where a JS
sprintf()
call in a template literal is used with a replacement value that includes HTML that should be treated as HTML.