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

Function test_attributes

css-inline/src/html/serializer.rs:918–938  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

916
917 #[test]
918 fn test_attributes() {
919 let doc = Document::parse_with_options(
920 b"<!DOCTYPE html><html><head></head><body data-foo='& \xC2\xA0 \"'></body></html>",
921 0,
922 InliningMode::Document,
923 );
924 let mut buffer = Vec::new();
925 doc.serialize(
926 &mut buffer,
927 vec![None; doc.nodes.len()],
928 false,
929 false,
930 false,
931 None,
932 InliningMode::Document,
933 false,
934 false,
935 )
936 .expect("Should not fail");
937 assert_eq!(buffer, b"<!DOCTYPE html><html><head></head><body data-foo=\"&amp; &nbsp; &quot;\"></body></html>");
938 }
939
940 #[test]
941 fn test_keep_at_rules_tags() {

Callers

nothing calls this directly

Calls 2

parse_with_optionsFunction · 0.85
serializeMethod · 0.45

Tested by

no test coverage detected