MCPcopy Index your code
hub / github.com/simstudioai/sim / preserveSoftBreaks

Function preserveSoftBreaks

apps/sim/lib/mothership/inbox/response.ts:267–272  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

265}
266
267function preserveSoftBreaks(text: string): string {
268 return text
269 .split(/(```[\s\S]*?```)/g)
270 .map((segment, i) => (i % 2 === 0 ? segment.replace(/([^\n])\n(?=[^\n])/g, '$1 \n') : segment))
271 .join('')
272}
273
274function stripUnsafeUrls(html: string): string {
275 return html.replace(/href\s*=\s*(['"])(?:javascript|vbscript|data):.*?\1/gi, 'href="#"')

Callers 1

renderEmailHtmlFunction · 0.85

Calls 2

joinMethod · 0.80
replaceMethod · 0.65

Tested by

no test coverage detected