diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ecc63017d21..0435312a37a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Use the correct property value for `place-content-between`, `place-content-around`, and `place-content-evenly` utilities ([#15440](https://github.com/tailwindlabs/tailwindcss/pull/15440)) +- Don’t detect arbitrary properties when preceded by an escape ([#15456](https://github.com/tailwindlabs/tailwindcss/pull/15456)) ### Changed diff --git a/crates/oxide/src/parser.rs b/crates/oxide/src/parser.rs index 281774261ad6..1c8fdf75c0f2 100644 --- a/crates/oxide/src/parser.rs +++ b/crates/oxide/src/parser.rs @@ -595,7 +595,7 @@ impl<'a> Extractor<'a> { fn parse_start(&mut self) -> ParseAction<'a> { match self.cursor.curr { // Enter arbitrary property mode - b'[' => { + b'[' if self.cursor.prev != b'\\' => { trace!("Arbitrary::Start\t"); self.arbitrary = Arbitrary::Brackets { start_idx: self.cursor.pos, @@ -1634,4 +1634,18 @@ mod test { ] ); } + + #[test] + fn arbitrary_properties_are_not_picked_up_after_an_escape() { + _please_trace(); + let candidates = run( + r#" + + \\[a\\]\\:block] + "#, + false, + ); + + assert_eq!(candidates, vec!["!code", "a"]); + } }