Skip to main content

format

Function format 

Source
pub fn format(
    content: &mut Element,
    path: &[usize],
    range: Range<usize>,
    mark: Mark,
    on: bool,
    styles: &mut Styles,
) -> Result<(), Refused>
Expand description

Give a range of the text of the paragraph at a path under the content root a mark, or take it off, writing into the root’s automatic styles whatever style that needs and telling styles of it.

A document with no office:automatic-styles is given one before its body, as the format orders them, 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 mark is written in. Each is refused before anything changes.