mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig.space.git
synced 2025-12-13 16:26:50 +00:00
Improve feed parser
This commit is contained in:
@@ -57,7 +57,9 @@ const parseEpisode = e => {
|
|||||||
if (categoryName === 'NostrTalk') categoryName = 'NostrTalk'
|
if (categoryName === 'NostrTalk') categoryName = 'NostrTalk'
|
||||||
if (categoryName === 'FilterFrei') categoryName = 'FilterFrei'
|
if (categoryName === 'FilterFrei') categoryName = 'FilterFrei'
|
||||||
const lines = descriptionPlain.trim().split('\n')
|
const lines = descriptionPlain.trim().split('\n')
|
||||||
const firstLine = lines.find(l => l.match(regexBlockzeit)) || lines[0] || ''
|
const firstLine = lines.length === 1
|
||||||
|
? stripHTML(description.match(/^.*?<\/p>/)[0] || '')
|
||||||
|
: lines.find(l => l.match(regexBlockzeit)) || lines[0] || ''
|
||||||
const blockMatch = firstLine.match(regexBlockzeit)
|
const blockMatch = firstLine.match(regexBlockzeit)
|
||||||
const block = blockMatch ? parseInt(blockMatch[1].replace('.', '')) : null
|
const block = blockMatch ? parseInt(blockMatch[1].replace('.', '')) : null
|
||||||
const category = slugify(categoryName)
|
const category = slugify(categoryName)
|
||||||
|
|||||||
Reference in New Issue
Block a user