File tree 4 files changed +31
-0
lines changed
4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
22
22
- Ensure utilities are sorted based on their actual property order ([ #16995 ] ( https://github.com/tailwindlabs/tailwindcss/pull/16995 ) )
23
23
- Ensure strings in Pug and Slim templates are handled correctly ([ #17000 ] ( https://github.com/tailwindlabs/tailwindcss/pull/17000 ) )
24
24
- Ensure ` } ` and ` { ` are valid boundary characters when extracting candidates ([ #17001 ] ( https://github.com/tailwindlabs/tailwindcss/pull/17001 ) )
25
+ - Add ` razor ` /` cshtml ` pre processing ([ #17027 ] ( https://github.com/tailwindlabs/tailwindcss/pull/17027 ) )
25
26
26
27
## [ 4.0.11] - 2025-03-06
27
28
Original file line number Diff line number Diff line change 1
1
pub mod pre_processor;
2
2
pub mod pug;
3
+ pub mod razor;
3
4
pub mod ruby;
4
5
pub mod slim;
5
6
pub mod svelte;
6
7
7
8
pub use pre_processor:: * ;
8
9
pub use pug:: * ;
10
+ pub use razor:: * ;
9
11
pub use ruby:: * ;
10
12
pub use slim:: * ;
11
13
pub use svelte:: * ;
Original file line number Diff line number Diff line change
1
+ use crate :: extractor:: pre_processors:: pre_processor:: PreProcessor ;
2
+ use bstr:: ByteSlice ;
3
+
4
+ #[ derive( Debug , Default ) ]
5
+ pub struct Razor ;
6
+
7
+ impl PreProcessor for Razor {
8
+ fn process ( & self , content : & [ u8 ] ) -> Vec < u8 > {
9
+ content. replace ( "@@" , " @" )
10
+ }
11
+ }
12
+
13
+ #[ cfg( test) ]
14
+ mod tests {
15
+ use super :: Razor ;
16
+ use crate :: extractor:: pre_processors:: pre_processor:: PreProcessor ;
17
+
18
+ #[ test]
19
+ fn test_razor_pre_processor ( ) {
20
+ let ( input, expected) = (
21
+ r#"<div class="@@sm:text-red-500">"# ,
22
+ r#"<div class=" @sm:text-red-500">"# ,
23
+ ) ;
24
+ Razor :: test ( input, expected) ;
25
+ Razor :: test_extract_contains ( input, vec ! [ "@sm:text-red-500" ] ) ;
26
+ }
27
+ }
Original file line number Diff line number Diff line change @@ -468,6 +468,7 @@ pub fn pre_process_input(content: &[u8], extension: &str) -> Vec<u8> {
468
468
use crate :: extractor:: pre_processors:: * ;
469
469
470
470
match extension {
471
+ "cshtml" | "razor" => Razor . process ( content) ,
471
472
"pug" => Pug . process ( content) ,
472
473
"rb" | "erb" => Ruby . process ( content) ,
473
474
"slim" => Slim . process ( content) ,
You can’t perform that action at this time.
0 commit comments