(block: HTMLPreElement)
| 180 | } |
| 181 | |
| 182 | function codeLanguage(block: HTMLPreElement) { |
| 183 | const code = block.querySelector("code") |
| 184 | if (!(code instanceof HTMLElement)) return |
| 185 | return code.className.match(/(?:^|\s)language-([^\s]+)/)?.[1] |
| 186 | } |
| 187 | |
| 188 | function applyCodeMetadata(wrapper: HTMLElement, language: string | undefined) { |
| 189 | if (!document.body.hasAttribute("data-new-layout")) { |