Inline CSS into an HTML fragment. Unlike [`inline`](CSSInliner::inline), this method does not wrap the output in ` ` and ` ` tags. Structural tags (` `, ` `, ` `) are stripped from the output; only their contents are preserved. CSS from ` ` tags within the input is also processed and inlined. If you need to preserve the full HTML document structure, use [`inline`](
(&self, html: &str, css: &str)
| 610 | /// This function may panic if external stylesheet cache lock is poisoned, i.e. another thread |
| 611 | /// using the same inliner panicked while resolving external stylesheets. |
| 612 | pub fn inline_fragment(&self, html: &str, css: &str) -> Result<String> { |
| 613 | let mut out = allocate_output_buffer(html); |
| 614 | self.inline_fragment_to(html, css, &mut out)?; |
| 615 | Ok(String::from_utf8_lossy(&out).to_string()) |
| 616 | } |
| 617 | |
| 618 | /// Inline CSS into an HTML fragment and write the result to a generic writer. |
| 619 | /// |
no test coverage detected