MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getThumbnailFromMatch

Function getThumbnailFromMatch

site/thumbnail.ts:19–25  ·  view source on GitHub ↗
(match: RegExpMatchArray)

Source from the content-addressed store, hash-verified

17 /!\[([^\]]*)\]\(\s*([^) \t\r\n]+)\s*(?:(?:"([^"]*)"|'([^']*)'))?\s*\)/;
18
19const getThumbnailFromMatch = (match: RegExpMatchArray): Thumbnail => ({
20 alt: match[1] ?? '',
21 src: match[2] ?? '',
22 ...(match[3] == null && match[4] == null
23 ? {}
24 : {title: match[3] ?? match[4]}),
25});
26
27const parseLeadingImage = (markdown: string): Thumbnail | undefined => {
28 const match = markdown.match(new RegExp(`^${IMAGE_MARKDOWN.source}\\s*$`));

Callers 2

parseLeadingImageFunction · 0.85
findFirstImageFunction · 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…