* Checks if the given node is a valid code element. * * @param {import('unist').Node} node - The node to be verified. * * @return {boolean} - True when it is a valid code element, false otherwise.
(node)
| 48 | * @return {boolean} - True when it is a valid code element, false otherwise. |
| 49 | */ |
| 50 | function isCodeBlock(node) { |
| 51 | return Boolean( |
| 52 | node?.tagName === 'pre' && node?.children[0].tagName === 'code' |
| 53 | ); |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * @param {import('#rs/index.mjs').HighlighterOptions & { highlighter: import('#rs/highlighter.mjs').SyntaxHighlighter }} options |