feat: add docs, allow URLs & more - #255
Open
WarningImHack3r wants to merge 3 commits into
Open
Conversation
- add README-originated doc to user-facing properties - allow using `URL` in addition to `string` where relevant - sanitize URLs at more places, improving behavior consistency - fix item id being parsed as an URL since v6 - fix empty author arrays throwing
WarningImHack3r
commented
Jul 14, 2026
| const entry: convert.ElementCompact = { | ||
| title: { _attributes: { type: "html" }, _cdata: item.title }, | ||
| id: sanitizeUrl(item.id ?? item.link), | ||
| id: sanitize(item.id) ?? sanitizeUrl(item.link), |
WarningImHack3r
commented
Jul 14, 2026
| export function sanitizeUrl(url: string | undefined): string | undefined { | ||
| export function sanitizeUrl(url: string | URL, xml?: boolean): string; | ||
| export function sanitizeUrl(url: string | URL | undefined, xml?: boolean): string | undefined; | ||
| export function sanitizeUrl(url: string | URL | undefined, xml = true): string | undefined { |
Author
There was a problem hiding this comment.
A default value of false for xml would be better, but it would require changing every call to RSS/Atom instead of only JSON. Please tell me if you indeed prefer the opposite!
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.
Thanks for this library! I primarily wanted to fix the "id being parsed as a URL" issue and add docs to avoid having to open GitHub to understand the library, but my docs adjustments led to further (non-breaking) improvements.
I can understand if it's too much for one PR to review; don't hesitate if you want me to split it up. I'm reactive to feedback!
Changes
URLin addition tostringwhere relevant