MCPcopy Create free account
hub / github.com/Effect-TS/effect / codeSpan

Function codeSpan

packages/tools/api-diff/src/MigrationDoc.ts:33–37  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

31}
32
33const codeSpan = (value: string): string => {
34 const delimiter = "`".repeat(Math.max(1, ...(value.match(/`+/g)?.map((run) => run.length + 1) ?? [])))
35 const content = value.startsWith("`") || value.endsWith("`") ? ` ${value} ` : value
36 return `${delimiter}${content}${delimiter}`
37}
38
39const escapeMarkdownText = (value: string): string => value.replace(/\\/g, "\\\\").replace(/[~<>*_]/g, "\\$&")
40

Callers 3

renderDetailedEntryFunction · 0.85
renderCompactEntryFunction · 0.85
renderMigrationDocumentFunction · 0.85

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected