(node: Node)
| 21 | |
| 22 | export const TextSerializer = { |
| 23 | transform(node: Node): string { |
| 24 | if (Text.isText(node)) return escapeHtml(node.text) |
| 25 | const { children } = node |
| 26 | return children |
| 27 | .map(children => { |
| 28 | const text = this.transform(children) |
| 29 | return Editor.isEditor(node) ? text + '\n' : text |
| 30 | }) |
| 31 | .join('') |
| 32 | }, |
| 33 | |
| 34 | with<T = TextSerializerOptions>(transform: TextSerializerWithTransform<T>, options: T) { |
| 35 | const { transform: t } = this |
no outgoing calls
no test coverage detected
searching dependent graphs…