(pre: HTMLPreElement)
| 70 | } |
| 71 | |
| 72 | function ensureCodeBlockWrapper(pre: HTMLPreElement): HTMLElement { |
| 73 | const parent = pre.parentElement |
| 74 | if (parent?.classList.contains(CODE_BLOCK_CLASS)) return parent |
| 75 | |
| 76 | const wrapper = pre.ownerDocument.createElement('div') |
| 77 | wrapper.className = CODE_BLOCK_CLASS |
| 78 | pre.replaceWith(wrapper) |
| 79 | wrapper.append(pre) |
| 80 | return wrapper |
| 81 | } |
| 82 | |
| 83 | function ensureCodeBlockToolbar(wrapper: HTMLElement, pre: HTMLPreElement): void { |
| 84 | if (wrapper.querySelector(`.${CODE_BLOCK_TOOLBAR_CLASS}`)) return |
no outgoing calls
no test coverage detected