Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing html|* reports it is a Compound Selector #44

Closed
bramus opened this issue Jan 20, 2023 · 4 comments
Closed

Parsing html|* reports it is a Compound Selector #44

bramus opened this issue Jan 20, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@bramus
Copy link
Contributor

bramus commented Jan 20, 2023

Output for parsing a namespaced * is this:

{
	"type": "compound",
	"list": [
		{
			"type": "type",
			"content": "html",
			"name": "html",
			"pos": [
				0,
				4
			]
		},
		"|",
		{
			"type": "type",
			"content": "*",
			"pos": [
				5,
				6
			]
		}
	]
}

This is incorrect. It’s simply namespaced universal selector.

Regular namespaced selectors – such as html|p – work fine:

{
	"type": "type",
	"content": "html|p",
	"namespace": "html",
	"name": "p",
	"pos": [
		0,
		6
	]
}

While drafting this issue, I noticed same thing happens when trying to parse html|. It’s also reported as Compound Selector.

@LeaVerou LeaVerou added the bug Something isn't working label Jan 21, 2023
@LeaVerou
Copy link
Owner

Regular namespaced selectors – such as html|p – work fine:

{
	"type": "compound",
	"list": [
		{
			"type": "type",
			"content": "html",
			"name": "html",
			"pos": [
				0,
				4
			]
		},
		"|",
		{
			"type": "type",
			"content": "*",
			"pos": [
				5,
				6
			]
		}
	]
}

I think you pasted the wrong code, this is what's produced (which is indeed correct):

{
	"type": "type",
	"content": "html|p",
	"namespace": "html",
	"name": "p",
	"pos": [
		0,
		6
	]
}

@bramus
Copy link
Contributor Author

bramus commented Jan 22, 2023

I think you pasted the wrong code

That was a copy-paste error on my part indeed. I have updated the original post to include the correct snippet.

@david-luna
Copy link
Contributor

I think this one is already fixed in this PR

@bramus
Copy link
Contributor Author

bramus commented Feb 2, 2023

@david-luna Correct. Added an extra test in #46, verifying this.

@bramus bramus closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants