pub fn replace(paragraph: &mut Element, range: Range<usize>, with: &str)Expand description
Replace a range of the paragraph’s text, in characters, with new text.
The characters are removed from the nodes that hold them and the new text goes into the text node at the start of the range, or into a new one where none is there. Every element that contributes no characters stays where it was, so a bookmark inside the deleted range is a bookmark still. Whitespace is then written the way ODF requires, so the new text may hold tabs, newlines and runs of spaces.
A range past the end of the text is clamped to it.