Skip to main content

split_at

Function split_at 

Source
pub fn split_at(
    root: &mut Element,
    path: &[usize],
    at: usize,
) -> Result<Vec<usize>, Refused>
Expand description

Split the paragraph at a path under a root at a character offset, the second half becoming the paragraph after it, and answer where the second half is.

In a list item the second half begins a new item after it, as Enter does in a list, and whatever followed the paragraph in the item goes with it.

An item holding one empty paragraph is taken out of its list instead: the paragraph stands where the item was, between the two halves of the list.

ยงErrors

The path leads to nothing, or to something that is not a paragraph.