MCPcopy Create free account
hub / github.com/HubSpot/draft-convert / getSoftNewlineChunk

Function getSoftNewlineChunk

src/convertFromHTML.js:123–146  ·  view source on GitHub ↗
(block, depth, flat = false, data = Map())

Source from the content-addressed store, hash-verified

121}
122
123function getSoftNewlineChunk(block, depth, flat = false, data = Map()) {
124 if (flat === true) {
125 return {
126 text: '\r',
127 inlines: [OrderedSet()],
128 entities: new Array(1),
129 blocks: [
130 {
131 type: block,
132 data,
133 depth: Math.max(0, Math.min(MAX_DEPTH, depth)),
134 },
135 ],
136 isNewline: true,
137 };
138 }
139
140 return {
141 text: '\n',
142 inlines: [OrderedSet()],
143 entities: new Array(1),
144 blocks: [],
145 };
146}
147
148function getBlockDividerChunk(block, depth, data = Map()) {
149 return {

Callers 1

genFragmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…