Skip to content

Extract special @("@")md:… syntax in Razor files #17427

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

Merged
merged 3 commits into from
Mar 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add failing test
  • Loading branch information
RobinMalfait committed Mar 28, 2025
commit 0be53cf241f39230968e6b916d1aef8481ba8f9c
15 changes: 15 additions & 0 deletions crates/oxide/src/extractor/pre_processors/razor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,19 @@ mod tests {
Razor::test(input, expected);
Razor::test_extract_contains(input, vec!["@sm:text-red-500"]);
}

// https://github.com/tailwindlabs/tailwindcss/issues/17424
#[test]
fn test_razor_syntax_with() {
let (input, expected) = (
r#"<p class="@("@")md:bg-red-500 @@md:border-green-500 border-8">With 2 elements</p>"#,
r#"<p class=" @md:bg-red-500 @md:border-green-500 border-8">With 2 elements</p>"#,
);

Razor::test(input, expected);
Razor::test_extract_contains(
input,
vec!["@md:bg-red-500", "@md:border-green-500", "border-8"],
);
}
}