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

Function renderInlineLinks

packages/tools/jsdocs/src/Jsdocs.ts:1938–1948  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

1936}
1937
1938function renderInlineLinks(text: string): string {
1939 return text.replace(/\{@link\s+([^}]+)\}/g, (_match, content: string) => {
1940 const pipeIndex = content.indexOf("|")
1941 const beforeLabel = pipeIndex === -1 ? content.trim() : content.slice(0, pipeIndex).trim()
1942 const target = beforeLabel.split(/\s+/)[0] ?? ""
1943 const label = pipeIndex === -1
1944 ? beforeLabel.slice(target.length).trim() || target
1945 : content.slice(pipeIndex + 1).trim() || target
1946 return `\`${label.replace(/:var$/, "")}\``
1947 })
1948}
1949
1950function renderDescription(description: ParsedDescription): ParsedDescription {
1951 return {

Callers 3

renderDescriptionFunction · 0.85
renderExamplesFunction · 0.85
unresolvedSeeTagFunction · 0.85

Calls 2

replaceMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected