const TIDAL_EXTRACTOR = /^\/(?:(?.*?)\/)?(?(?:album|artist|episode|playlist|tracks?))\/(?[0-9]+)/gi; function embed_tidal(link_info) { const is_tidal_link = ["tidal.com", "tidalhi.fi"].includes(link_info.domain?.toLowerCase()); if (!is_tidal_link) { return; } TIDAL_EXTRACTOR.lastIndex = 0; const { groups: { action, item_type, item_id }, } = TIDAL_EXTRACTOR.exec(link_info.path ?? "") ?? { groups: {} }; if (!(item_type && item_id)) { return; } return `
`; }