-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing 'type="image/*"' attribute for image enclosures #37
Comments
ghost
mentioned this issue
May 20, 2017
same here. can we get an updated version? |
Here's a quick and dirty fix: const fs = require('fs')
const cheerio = require('cheerio')
const mime = require('mime-types')
const fixEnclosure = (rss) => {
const getLocalPath = (url) => url.replace('http://gitbit.org', './docs')
const $ = cheerio.load(rss, {xmlMode: true})
$('enclosure').each((idx, el) => {
const path = getLocalPath($(el).attr('url'))
const stats = fs.statSync(path)
$(el).attr('length', stats.size)
$(el).attr('type ', mime.lookup(path))
})
return $.html()
}
const rss = fixEnclosure(feed.rss2()) |
Please, if this is still an issue, feel free to re-open using the New Feature Issue template. Thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like feedly.com will not parse image enclosure node as images without type="image/*". found this: http://help.campaignmonitor.com/topic.aspx?t=277
Adding this attribute fixes the issue.
The text was updated successfully, but these errors were encountered: