MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / outlook_compatibility_example

Function outlook_compatibility_example

css-inline/tests/test_inlining.rs:1971–1993  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1969
1970#[test]
1971fn 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]
1996fn apply_dimensions_all_supported_elements() {

Callers

nothing calls this directly

Calls 4

buildMethod · 0.45
inlineMethod · 0.45

Tested by

no test coverage detected