Skip to content

Commit

Permalink
Unescape visible code tags in release-actions component
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianuibar committed Apr 15, 2024
1 parent f791e9e commit cdb4a5f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions assets/js/components/release-actions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { components, html, i18n } from '../utils/index.js';
import { components, element, html, i18n } from '../utils/index.js';

const { Button, TextControl } = components;
const { createElement, createInterpolateElement } = element;
const { __, sprintf } = i18n;

const selectField = ( e ) => e.nativeEvent.target.select();
Expand All @@ -19,8 +20,10 @@ function ReleaseActions( props ) {
/* translators: %s: version number */
const buttonText = __( 'Download %s', 'satispress' );

/* translators: %s: <code>composer.json</code> */
const copyPasteText = __( 'Copy and paste into %s', 'satispress' );
const copyPasteHtml = createInterpolateElement(
__( 'Copy and paste into <code>composer.json</code>', 'satispress' ),
{ code: createElement( 'code' ) }
);

return html`
<div className="satispress-release-actions">
Expand Down Expand Up @@ -51,7 +54,7 @@ function ReleaseActions( props ) {
onClick=${ selectField }
/>
<span className="description">
<em>${ sprintf( copyPasteText, '<code>composer.json</code>' ) }</em>
<em>${ copyPasteHtml }</em>
</span>
</td>
</tr>
Expand Down

0 comments on commit cdb4a5f

Please sign in to comment.