()
| 1 | import { markdownToHtmlBasic } from './markdownConversion'; |
| 2 | |
| 3 | const generateFallbackId = (): string => { |
| 4 | const cryptoApi = |
| 5 | typeof globalThis !== 'undefined' |
| 6 | ? (globalThis.crypto as Crypto | undefined) |
| 7 | : undefined; |
| 8 | if (cryptoApi?.randomUUID) { |
| 9 | return cryptoApi.randomUUID().slice(0, 8); |
| 10 | } |
| 11 | |
| 12 | return `${Date.now()}${Math.random().toString(36).slice(2)}`.slice(0, 8); |
| 13 | }; |
| 14 | |
| 15 | export const removeLinkTargetElement = (link: string): string => { |
| 16 | const { origin, pathname, search } = new URL(link); |
no test coverage detected