MCPcopy Index your code
hub / github.com/editablejs/editable / findSyntax

Function findSyntax

packages/plugins/codeblock/src/deserializer/html.ts:16–27  ·  view source on GitHub ↗
(node: HTMLElement)

Source from the content-addressed store, hash-verified

14}
15
16const findSyntax = (node: HTMLElement) => {
17 const classList = node.classList
18 for (let i = 0; i < classList.length; i++) {
19 const className = classList.item(i)
20 if (className && className.startsWith(`${CODEBLOCK_LANGUAGE}-`)) {
21 const classArray = className.split('-')
22 classArray.shift()
23 return classArray.join('-')
24 }
25 }
26 return null
27}
28
29export const withCodeBlockHTMLDeserializerTransform: HTMLDeserializerWithTransform = next => {
30 return (node, options = {}) => {

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…