Conversation
Apple and Google Play both require the category name as a text attribute. xml-js was given a raw string, so it emitted element text instead, and does not escape & in attributes on its own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
podcast: trueandcategory: "History", RSS 2.0 now emits<itunes:category text="History"/>(and the same shape forgoogleplay:category) instead of<itunes:category>History</itunes:category>.sanitize()so names likeSociety & Culturebecometext="Society & Culture". xml-js does not escape&in attributes (same workaround as fix(atom): escape & in category attribute values聽#249 for Atom categories). Nested iTunes subcategories are not added;FeedOptions.categoryis still a single string.Decision
_attributes: { text }for both iTunes and Google Play, plussanitize().itunes:category; leave Google Play as element text; skip sanitizing because the reporter's example wasHistory.textattribute oncategory. Apple's guide requires escaping ampersands, and several official category names contain&. xml-js will not escape those once the value is an attribute.xml-js emits a self-closing tag with no space before
/>. Apple's examples include a space. That is equivalent XML; this renderer already serializes empty elements that way.Test plan
pnpm test src/__tests__/rss2.spec.ts, new tests fail without the renderer change and pass with itpnpm test, 31 tests pass; existing podcast snapshot unchanged (it never setoptions.category)pnpm lintandpnpm formatclean onsrc