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

Function editorElementToYText

packages/yjs-transform/src/index.ts:34–43  ·  view source on GitHub ↗
({ children, ...attributes }: T)

Source from the content-addressed store, hash-verified

32}
33
34export function editorElementToYText<T extends Element>({ children, ...attributes }: T): Y.XmlText {
35 const yElement = new Y.XmlText()
36
37 Object.entries(attributes).forEach(([key, value]) => {
38 yElement.setAttribute(key, value)
39 })
40
41 yElement.applyDelta(editorNodesToInsertDelta(children), { sanitize: false })
42 return yElement
43}
44
45export * from './editable'
46

Callers 3

initPersistenceFunction · 0.90
insertNodeFunction · 0.90
editorNodesToInsertDeltaFunction · 0.85

Calls 1

editorNodesToInsertDeltaFunction · 0.85

Tested by

no test coverage detected