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

Selector for element with attribute is lost #299

Open
kesselb opened this issue Aug 10, 2021 · 0 comments · May be fixed by #300
Open

Selector for element with attribute is lost #299

kesselb opened this issue Aug 10, 2021 · 0 comments · May be fixed by #300

Comments

@kesselb
Copy link

kesselb commented Aug 10, 2021

Hi 👋

We are using htmlpurifier for nextcloud/mail to sanitize the body of html messages and have a bug report that a mail is not rendered correctly (nextcloud/mail#5279).

I debugged the mail body and found that

* img[tabindex="0"] + div { text-align:center }

is rewritten to

* + div { text-align:center }

if ($y === '*' || isset($html_definition->info[$y = strtolower($y)])) {

image

A test case for ExtractStyleBlocksTest:

	public function test_cleanCSS_elementWithAttribute()
	{
		$this->assertCleanCSS(
			"* img[tabindex=\"0\"] + div {\ntext-align:center\n}",
			"* img + div {\ntext-align:center\n}"
		);
	}
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 a pull request may close this issue.

1 participant