Skip to content

Replace is-url with is-url-superb#307

Draft
XhmikosR wants to merge 6 commits intomainfrom
xmr/is-url-superb
Draft

Replace is-url with is-url-superb#307
XhmikosR wants to merge 6 commits intomainfrom
xmr/is-url-superb

Conversation

@XhmikosR
Copy link
Member

@XhmikosR XhmikosR commented Mar 2, 2026

@joscha: not 100% sure this is the same, since is-url-superb seems to not work with // (it's just using the Node.js URL constructor).

But this is what postcss-values-parser is using: https://github.com/shellscape/postcss-values-parser/blob/d95ae33212a5b46e093db03cb4e841b830daceb7/lib/nodes/Word.js#L40

You probably have a better idea if this patch is OK or not. :)

PS. makes me wonder if postcss-values-parser can be used directly instead of using is-url-superb?

@joscha
Copy link
Collaborator

joscha commented Mar 3, 2026

Gwen I created it we had // everywhere, so it would be better to make sure it's compatible. Regarding the values parser, I remember trying it out and then rolling my own, but I don't remember why, unfortunately. If we can call out to it, that would definitely be good, less customization.

XhmikosR added 6 commits March 3, 2026 16:01
- Replace all uses of the local parseValue() wrapper with direct calls to postCssParseValue().
- Improve getValueOrUrl() to correctly filter protocol-relative URLs by normalizing them before validation.
- Filter out falsey URL values when collecting references from declarations.
- Update debug messages for clearer context ("url() in @value" -> "url() in declaration").
- Remove the now unused parseValue() helper.
@XhmikosR XhmikosR force-pushed the xmr/is-url-superb branch from a21f262 to 6287000 Compare March 3, 2026 14:17
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.

2 participants