@@ -2,7 +2,6 @@ import { useMemo } from 'react';
22import { useTranslation } from 'react-i18next' ;
33import useCloudShellAvailable from '@console/webterminal-plugin/src/components/cloud-shell/useCloudShellAvailable' ;
44import { MARKDOWN_COPY_BUTTON_ID , MARKDOWN_EXECUTE_BUTTON_ID , MARKDOWN_SNIPPET_ID } from './const' ;
5- import { removeTemplateWhitespace } from './utils' ;
65
76import './showdown-extension.scss' ;
87
@@ -21,32 +20,36 @@ const useInlineExecuteCommandShowdownExtension = () => {
2120 groupId : string ,
2221 ) : string => {
2322 if ( ! group || ! subGroup || ! groupType || ! groupId ) return text ;
24- return removeTemplateWhitespace (
25- `<span class="pf-v5-c-clipboard-copy pf-m-inline">
26- <span class="pf-v5-c-clipboard-copy__text" ${ MARKDOWN_SNIPPET_ID } ="${ groupId } ">${ group . trim ( ) } </span>
27- <span class="pf-v5-c-clipboard-copy__actions">
28- <span class="pf-v5-c-clipboard-copy__actions-item">
29- <button class="pf-v5-c-button pf-m-plain" aria-label="${ t (
30- 'console-shared~Copy to clipboard' ,
31- ) } " ${ MARKDOWN_COPY_BUTTON_ID } ="${ groupId } ">
32- <i class="fas fa-copy" aria-hidden="true"></i>
33- </button>
34- </span>
35- ${
36- showExecuteButton
37- ? `<span class="pf-v5-c-clipboard-copy__actions-item ocs-markdown-execute-snippet__action">
38- <button class="pf-v5-c-button pf-m-plain ocs-markdown-execute-snippet__button" aria-label="${ t (
39- 'console-shared~Run in Web Terminal' ,
40- ) } " ${ MARKDOWN_EXECUTE_BUTTON_ID } ="${ groupId } ">
41- <i class="fas fa-play" aria-hidden="true"></i>
42- <i class="fas fa-check" aria-hidden="true"></i>
43- </button>
44- </span>`
45- : ''
46- }
47- </span>
48- </span>` ,
49- ) ;
23+ return `<div class="pf-v5-c-code-block">
24+ <div class="pf-v5-c-code-block__header">
25+ <div class="pf-v5-c-code-block__actions">
26+ <div class="pf-v5-c-code-block__actions-item">
27+ <button class="pf-v5-c-button pf-m-plain" type="button" aria-label="${ t (
28+ 'console-shared~Copy to clipboard' ,
29+ ) } " ${ MARKDOWN_COPY_BUTTON_ID } ="${ groupType } ">
30+ <i class="fas fa-copy" aria-hidden="true"></i>
31+ </button>
32+ </div>
33+ ${
34+ showExecuteButton
35+ ? `<div class="pf-v5-c-code-block__actions-item ocs-markdown-execute-snippet__action">
36+ <button class="pf-v5-c-button pf-m-plain ocs-markdown-execute-snippet__button" type="button" aria-label="${ t (
37+ 'console-shared~Run in Web Terminal' ,
38+ ) } " ${ MARKDOWN_EXECUTE_BUTTON_ID } ="${ groupType } ">
39+ <i class="fas fa-play" aria-hidden="true"></i>
40+ <i class="fas fa-check" aria-hidden="true"></i>
41+ </button>
42+ </div>`
43+ : ''
44+ }
45+ </div>
46+ </div>
47+ <div class="pf-v5-c-code-block__content">
48+ <pre class="pf-v5-c-code-block__pre pfext-code-block__pre">
49+ <code class="pf-v5-c-code-block__code" ${ MARKDOWN_SNIPPET_ID } ="${ groupType } ">${ group . trim ( ) } </code>
50+ </pre>
51+ </div>
52+ </div>` ;
5053 } ,
5154 } ) ,
5255 [ showExecuteButton , t ] ,
0 commit comments