From 2b37302fe5f7570238836d2aee943843673bf815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Mittelst=C3=A4dt?= <62167861+TheGalitube@users.noreply.github.com> Date: Thu, 29 Oct 2026 09:29:21 +0000 Subject: [PATCH] Preserve comment markers inside CSS strings Found while testing crates/svg/src/import/css.rs:346 Co-Authored-By: GPT-6-Luna --- crates/svg/src/import/css.rs | 35 +++++++++++++++++++++++++----- crates/svg/tests/it/import_text.rs | 7 ++++++ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/crates/svg/src/import/css.rs b/crates/svg/src/import/css.rs index 92b61a70a..30432771a 100644 --- a/crates/svg/src/import/css.rs +++ b/crates/svg/src/import/css.rs @@ -342,14 +342,37 @@ fn top_level_commas(list: &str) -> impl Iterator { /// Rules from every `x"#); + let t = only_text(&d); + assert_eq!(t.first_style().fill.color().map(|c| c.to_hex()).as_deref(), Some("#ff0000")); +} + #[test] fn css_selectors_reach_text() { let d = open(