pub struct EmbeddedContent<'a> {
pub language: EmbeddedLanguage,
pub content: &'a str,
pub indent_depth: usize,
pub file_byte_offset: usize,
}Expand description
A request to format embedded content within an SVG document.
§Examples
let embedded = svg_format::EmbeddedContent {
language: svg_format::EmbeddedLanguage::Css,
content: ".icon{fill:red}",
indent_depth: 1,
file_byte_offset: 12,
};
assert_eq!(embedded.language, svg_format::EmbeddedLanguage::Css);Fields§
§language: EmbeddedLanguageThe language of the embedded content.
content: &'a strThe raw content text (common indent removed).
indent_depth: usizeThe nesting depth in the SVG tree where this content lives.
file_byte_offset: usizeByte offset in the original SVG source where the embedded payload
begins: the first non-whitespace content byte, past any <![CDATA[
prefix and the common leading indentation.
This is a block anchor, not a byte-for-byte map. content is a
transformed view of the source — common indentation is stripped per
line, CRLF is normalized to LF, and (outside CDATA) XML entities are
decoded — so it is generally not byte-identical to
&source[file_byte_offset..]. A host callback can use this to locate
where the embedded region starts, but interior (line, col) positions
within content cannot be recovered by counting bytes from this
offset; that would require a full source map.