pub struct Frontmatter {
pub value: String,
pub info: String,
pub fence: char,
pub fence_length: usize,
pub closing_fence_length: usize,
pub position: Option<Position>,
}Expand description
Language-agnostic frontmatter with an optional, opaque format hint.
The contents are raw text. An explicit info string identifies the language;
untagged --- and +++ delimiters imply YAML and TOML respectively.
The Markdown parser leaves decoding the contents to callers.
Markdown serialization retains the stored info string and body while normalizing spacing around the info string. Edited content can require a longer fence, a different marker, or a trailing body line ending to keep the frontmatter valid.
Fields§
§value: StringRaw content between the fence lines, including its trailing line ending.
info: StringThe whole info string, with surrounding spaces and tabs removed.
Escapes and character references remain literal, as in Markly.
Empty for an implicit language; use language() to resolve the default.
fence: charOpening fence marker: a backtick, tilde, dash, or plus.
fence_length: usizeNumber of opening fence markers. Serialization may lengthen the fence to keep edited content from closing it prematurely.
closing_fence_length: usizeNumber of closing fence markers. Closing code fences can be longer than their opening fence.
position: Option<Position>Source position, including the fences.