pub fn set_heading(
content: &mut Element,
path: &[usize],
level: Option<u8>,
styles: &mut Styles,
) -> Result<(), Refused>Expand description
Make a paragraph a heading of a level, or body text again.
A paragraph that is already what is asked for is left alone. The paragraph’s own style is replaced, which is what applying a paragraph style is; its text, its spans and everything in it stay.
A document with no office:automatic-styles is given one before its body
when a heading style has to be written, which moves the body one place
along: a path held from before the edit is to be taken again.
§Errors
The path does not lead to a paragraph, or the content root does not declare a namespace the edit writes in. Each is refused before anything changes.