Skip to content

feat: allow omitting <generator> via generator: false - #251

Merged
jpmonette merged 1 commit into
jpmonette:masterfrom
mmilanovic4:feat/generator-false
Jul 5, 2026
Merged

feat: allow omitting <generator> via generator: false#251
jpmonette merged 1 commit into
jpmonette:masterfrom
mmilanovic4:feat/generator-false

Conversation

@mmilanovic4

Copy link
Copy Markdown
Contributor

Currently generator only accepts a string and always falls back to the
library URL, so there's no way to remove the element. Passing
false leaks into RSS output as false and is
silently ignored in Atom.

This widens FeedOptions.generator to string | false and skips the
element entirely when false, for both RSS 2.0 and Atom 1.0. Default and
custom-string behaviour is unchanged; existing snapshots pass untouched.
Added unit tests covering default / custom / omitted cases for both formats.

Closes #250

The generator field previously only accepted a string and always fell
back to the library URL, so there was no way to remove the <generator>
element from the output. Passing a falsy value such as false leaked into
the XML as <generator>false</generator> in RSS, or was ignored in Atom.

Widen FeedOptions.generator to string | false and skip emitting the
element entirely when it is false, for both RSS 2.0 and Atom 1.0. The
default and custom-string behaviour is unchanged.

Covered by unit tests for both formats.
@jpmonette

Copy link
Copy Markdown
Owner

ty @mmilanovic4

@jpmonette
jpmonette merged commit 2a26184 into jpmonette:master Jul 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to omit the <generator> element (generator: false renders literally)

2 participants