MCPcopy Create free account
hub / github.com/dailydotdev/apps / wrapLines

Function wrapLines

packages/shared/src/lib/markdownConversion.ts:209–224  ·  view source on GitHub ↗
(value: string, marker: InlineMarker)

Source from the content-addressed store, hash-verified

207 node instanceof Element && ['em', 'i'].includes(node.tagName.toLowerCase());
208
209const wrapLines = (value: string, marker: InlineMarker): string =>
210 value
211 .split('\n')
212 .map((line) => {
213 const content = line.trim();
214
215 if (!content) {
216 return line;
217 }
218
219 const leading = line.slice(0, line.indexOf(content));
220 const trailing = line.slice(leading.length + content.length);
221
222 return `${leading}${marker}${content}${marker}${trailing}`;
223 })
224 .join('\n');
225
226// Mutually recursive functions for inline serialization
227function serializeChildren(node: Element): string {

Callers 2

serializeChildrenFunction · 0.85
serializeInlineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected