... am Endes Beitrages nur, wenn der Beitrag mehr als 250 Zeichen hat

This commit is contained in:
Akamaru 2016-02-02 16:15:48 +01:00
parent f23fe5f409
commit a057e25f05
1 changed files with 10 additions and 2 deletions

View File

@ -183,9 +183,17 @@ local function cron()
local title = v2.title or 'Kein Titel'
local link = v2.link or v2.id or 'Kein Link'
if v2.content then
content = string.sub(unescape_for_rss(v2.content:gsub("%b<>", "")), 1, 250) .. '...'
if string.len(v2.content) > 250 then
content = string.sub(unescape_for_rss(v2.content:gsub("%b<>", "")), 1, 250) .. '...'
else
content = unescape_for_rss(v2.content:gsub("%b<>", ""))
end
elseif v2.summary then
content = string.sub(unescape_for_rss(v2.summary:gsub("%b<>", "")), 1, 250) .. '...'
if string.len(v2.summary) > 250 then
content = string.sub(unescape_for_rss(v2.summary:gsub("%b<>", "")), 1, 250) .. '...'
else
content = unescape_for_rss(v2.summary:gsub("%b<>", ""))
end
else
content = ''
end