(blockElement: HTMLElement | null)
| 179 | }; |
| 180 | |
| 181 | export const isCmCodeBlock = (blockElement: HTMLElement | null) => { |
| 182 | if (!blockElement) { |
| 183 | return false; |
| 184 | } |
| 185 | const dataType = blockElement.getAttribute("data-type"); |
| 186 | if (!dataType || !CM_BLOCK_DATA_TYPES.has(dataType)) { |
| 187 | return false; |
| 188 | } |
| 189 | if (!getBlockParts(blockElement)) { |
| 190 | return false; |
| 191 | } |
| 192 | if (isSpecialBlock(blockElement)) { |
| 193 | return blockElement.classList.contains(CM_EDITING_CLASS); |
| 194 | } |
| 195 | return true; |
| 196 | }; |
| 197 | |
| 198 | /** @deprecated use isCmCodeBlock */ |
| 199 | export const isWysiwygCmCodeBlock = isCmCodeBlock; |
no test coverage detected