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

Function overwrite_style_node

css-inline/src/lib.rs:339–347  ·  view source on GitHub ↗
(document: &mut Document, node_id: NodeId, new_css: &str)

Source from the content-addressed store, hash-verified

337}
338
339fn overwrite_style_node(document: &mut Document, node_id: NodeId, new_css: &str) {
340 let new_css = new_css.trim();
341 if let Some(text_node_id) = document[node_id].first_child {
342 if let NodeData::Text { text } = &mut document[text_node_id].data {
343 text.clear();
344 text.push_slice(new_css);
345 }
346 }
347}
348
349impl<'a> InlineOptions<'a> {
350 /// Override whether "style" tags should be inlined.

Callers 2

rewrite_style_blocksFunction · 0.85
handle_empty_remainderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected