mirror of
https://github.com/dergigi/boris.git
synced 2026-01-03 06:54:53 +01:00
fix: handle web bookmarks with URLs in d tag and prevent crash
- Extract URL from 'd' tag for kind:39701 web bookmarks - Add protocol prefix (https://) if missing from web bookmark URLs - Make classifyUrl handle undefined input gracefully - Prevent crash when web bookmarks have no content
This commit is contained in:
@@ -13,7 +13,10 @@ export interface UrlClassification {
|
||||
buttonText: string
|
||||
}
|
||||
|
||||
export const classifyUrl = (url: string): UrlClassification => {
|
||||
export const classifyUrl = (url: string | undefined): UrlClassification => {
|
||||
if (!url) {
|
||||
return { type: 'article', buttonText: 'READ NOW' }
|
||||
}
|
||||
const urlLower = url.toLowerCase()
|
||||
|
||||
// Check for YouTube
|
||||
|
||||
Reference in New Issue
Block a user