(i18n: I18n)
| 14 | const debug = logger('code:'); |
| 15 | |
| 16 | function renderCopyButton(i18n: I18n) { |
| 17 | const selector = 'a.mu-code-copy'; |
| 18 | const iconVnode = h( |
| 19 | 'i.icon', |
| 20 | h( |
| 21 | 'i.icon-inner', |
| 22 | { |
| 23 | style: { |
| 24 | 'background': `url(${copyIcon}) no-repeat`, |
| 25 | 'background-size': '100%', |
| 26 | }, |
| 27 | }, |
| 28 | '', |
| 29 | ), |
| 30 | ); |
| 31 | |
| 32 | return h( |
| 33 | selector, |
| 34 | { |
| 35 | attrs: { |
| 36 | title: i18n.t('Copy content'), |
| 37 | contenteditable: 'false', |
| 38 | }, |
| 39 | }, |
| 40 | iconVnode, |
| 41 | ); |
| 42 | } |
| 43 | |
| 44 | class Code extends Parent { |
| 45 | public override parent: Nullable<CodeBlock> = null; |
no test coverage detected