mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Remove www in the hostname if exists
This commit is contained in:
parent
b4ec812f41
commit
412d7cebc6
1 changed files with 2 additions and 2 deletions
|
|
@ -6,10 +6,10 @@ import { PageType } from '../../../lib/networking/fragments/articleFragment'
|
|||
|
||||
const siteName = (originalArticleUrl: string, itemUrl: string): string => {
|
||||
try {
|
||||
return new URL(originalArticleUrl).hostname
|
||||
return new URL(originalArticleUrl).hostname.replace(/^www\./, '')
|
||||
} catch {}
|
||||
try {
|
||||
return new URL(itemUrl).hostname
|
||||
return new URL(itemUrl).hostname.replace(/^www\./, '')
|
||||
} catch {}
|
||||
return ''
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue