-
Notifications
You must be signed in to change notification settings - Fork 30
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
CDATA in description not parsed as desired #66
Comments
@CoryKniefel could you share link to that feed source so I can investigate its content structure? (I can not access |
I emailed you at the link. Please let me know if you didn't receive. |
@CoryKniefel I received. Maybe I can detect the problem there. |
@CoryKniefel you can use getExtraEntryFields. This is a function that allows you to customize the output, add or modify any part of feed data. Please try this and let's me know if the result matches your expectation: import { read } from '@extractus/feed-extractor'
const YOUR_FEED_URL = 'https://a...'
await read(YOUR_FEED_URL, {
getExtraEntryFields: (feedEntry) => {
const { description: content } = feedEntry
return {
content,
}
}
}) |
Yes, matches expectations perfectly. Thanks for showing me how that works. |
Hi Team,
Thanks for building this open-source tool. I'm new to dealing with RSS feeds and wanted an easy way to parse the data into typed objects. I'm having an issue with one feed where they have embedded A LOT Of CDATA in the description, with a lot of HTML with styles and links to images, etc..
Here is an example:
(NOTE: some of this is being hidden by the browser; open this issue in Edit view to see all the data might work. If there is a way to prevent it from rendering as HTML in this Issue, I don't know how.)
Options:
{ descriptionMaxLen: 20000, xmlParserOptions: { // I've tried a bunch. . . nothing "worked"} }
Output:
Desired output: All contents of the description CDATA
Questions:
The text was updated successfully, but these errors were encountered: