From fd9ae7b2dd2bc6ba236867ca8da162933ff2dd55 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 26 Feb 2026 11:54:15 +0100 Subject: [PATCH 1/2] add failing test --- crates/oxide/src/extractor/pre_processors/ruby.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/oxide/src/extractor/pre_processors/ruby.rs b/crates/oxide/src/extractor/pre_processors/ruby.rs index 1f2221414ff4..743273b16235 100644 --- a/crates/oxide/src/extractor/pre_processors/ruby.rs +++ b/crates/oxide/src/extractor/pre_processors/ruby.rs @@ -388,6 +388,20 @@ mod tests { Ruby::test_extract_contains(input, vec!["z-1", "z-2", "z-3"]); } + // https://github.com/tailwindlabs/tailwindcss/issues/19728 + #[test] + fn test_heredoc_with_unknown_language() { + let input = r#" + def width_class(width = nil) + <<~STYLE_CLASS + #{width || 'w-100'} + STYLE_CLASS + end + "#; + + Ruby::test_extract_contains(input, vec!["w-100"]); + } + // https://github.com/tailwindlabs/tailwindcss/issues/19239 #[test] fn test_skip_comments() { From e742f338261ba8900c52b510b34a9248763ed2c7 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 26 Feb 2026 11:54:25 +0100 Subject: [PATCH 2/2] extract classes using interpolation syntax in Ruby --- crates/oxide/src/extractor/pre_processors/ruby.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/oxide/src/extractor/pre_processors/ruby.rs b/crates/oxide/src/extractor/pre_processors/ruby.rs index 743273b16235..5a3a0fabbfc7 100644 --- a/crates/oxide/src/extractor/pre_processors/ruby.rs +++ b/crates/oxide/src/extractor/pre_processors/ruby.rs @@ -124,7 +124,9 @@ impl PreProcessor for Ruby { // Except for strict locals, these are defined in a `<%# locals: … %>`. Checking if // the comment is preceded by a `%` should be enough without having to perform more // parsing logic. Worst case we _do_ scan a few comments. - b'#' if !matches!(cursor.prev(), b'%') => { + // + // We also want to skip interpolation syntax, which look like `#{…}`. + b'#' if !matches!(cursor.prev(), b'%') && !matches!(cursor.next(), b'{') => { result[cursor.pos] = b' '; cursor.advance(); @@ -390,7 +392,7 @@ mod tests { // https://github.com/tailwindlabs/tailwindcss/issues/19728 #[test] - fn test_heredoc_with_unknown_language() { + fn test_interpolated_expressions() { let input = r#" def width_class(width = nil) <<~STYLE_CLASS