--- /** * Portable Text link mark for issue bodies: an off-site link is a citation, * marked up as an `h-cite` (name + url) so microformats parsers see each * bookmark; a `/tag/` link is a rel-tag `p-category` of the issue * (the `#` is CSS, so the category value is the bare tag); other on-site * and anchor links stay plain. * * @see https://microformats.org/wiki/h-cite * @see https://microformats.org/wiki/rel-tag */ export interface Props { node: { markDef: { _type: "link"; _key: string; href: string; blank?: boolean } }; } const href = Astro.props.node?.markDef?.href ?? ""; // only these schemes become hrefs (the stored href is editor input) const safe = /^(https?:|mailto:|\/|#)/i.test(href) ? href : ""; const offSite = /^https?:/i.test(safe); const isTag = safe.startsWith("/tag/"); --- { offSite ? ( ) : isTag ? ( ) : ( ) }