Skip to content

Adding sanitisation to xml #248

Description

@shivan-s

I'm wondering if its worth adding sanisation all inputs for the feed.

import { Feed } from 'feed';

export const feed = new Feed({
// ...
});

const posts = [
   { 
       // ...
       title: 'Foo & Bar',
   }
]
posts.forEach(({ title, ...rest }) => {
	feed.addItem({
		title,
                ...rest,
	});
}); 

feed.rss2()

I believe the ampersand in the title will cause problems. Please let me know if I'm missing something here or we leave it up to the user to sanitise the title in this case.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions