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)])) { |

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}"
);
}
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 }htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
Line 243 in c97bb93
A test case for
ExtractStyleBlocksTest: