()
| 1969 | |
| 1970 | #[test] |
| 1971 | fn outlook_compatibility_example() { |
| 1972 | // Test simulating Outlook-compatible email HTML |
| 1973 | let inliner = CSSInliner::options() |
| 1974 | .apply_width_attributes(true) |
| 1975 | .apply_height_attributes(true) |
| 1976 | .build(); |
| 1977 | let html = r#"<html><head><style> |
| 1978 | img { width: 600px; height: 400px; } |
| 1979 | table { width: 100%; } |
| 1980 | td { width: 50%; height: 100px; } |
| 1981 | </style></head><body> |
| 1982 | <table><tr><td><img src="photo.jpg"></td></tr></table> |
| 1983 | </body></html>"#; |
| 1984 | let result = inliner.inline(html).unwrap(); |
| 1985 | // Verify: width="600" height="400" on img |
| 1986 | assert!(result.contains(r#"width="600""#)); |
| 1987 | assert!(result.contains(r#"height="400""#)); |
| 1988 | // Verify: width="100%" on table |
| 1989 | assert!(result.contains(r#"width="100%""#)); |
| 1990 | // Verify: width="50%" height="100" on td |
| 1991 | assert!(result.contains(r#"width="50%""#)); |
| 1992 | assert!(result.contains(r#"height="100""#)); |
| 1993 | } |
| 1994 | |
| 1995 | #[test] |
| 1996 | fn apply_dimensions_all_supported_elements() { |
nothing calls this directly
no test coverage detected