INNER CODE UNIT · TypeScript

descriptionAfterLink

ahmet/awesome-web3 · lib/catalog.ts:93

function descriptionAfterLink(nodes: MdNode[]) {
  const idx = nodes.findIndex((node) => node.type === 'link')
  if (idx === -1) return ''
  return textOf({ type: 'paragraph', children: nodes.slice(idx + 1) })
    .replace(/^\s*[-–—:]\s*/, '')
    .trim()
}

function stripHtml(value: string) {
  return value
    .replace(/<[^>]+>/g, ' ')
    .replace(/\s+/g, ' ')
    .trim()
}

export type CatalogProps = {
  title: string
  description: string

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…