pub struct NormalizeOptions {
pub merge_adjacent_text: bool,
pub remove_empty_text: bool,
pub remove_empty_nodes: bool,
}Expand description
Options controlling Node::normalize_with. Default is the sensible
hygiene pass: merge adjacent text and drop empty text, but keep empty nodes
(an empty paragraph is structurally valid).
Fields§
§merge_adjacent_text: boolMerge consecutive text nodes that are identical except for text
(same marks, attrs, extra) by concatenating their text.
remove_empty_text: boolDrop text nodes whose text is empty ("" or absent).
remove_empty_nodes: boolDrop non-text nodes whose content is an empty list (Some([])).
Off by default: an empty paragraph is valid. Absent (None) content is
always left untouched, preserving the empty-vs-missing distinction.
Trait Implementations§
Source§impl Clone for NormalizeOptions
impl Clone for NormalizeOptions
impl Copy for NormalizeOptions
Source§impl Debug for NormalizeOptions
impl Debug for NormalizeOptions
Source§impl Default for NormalizeOptions
impl Default for NormalizeOptions
Source§impl<'de> Deserialize<'de> for NormalizeOptionswhere
NormalizeOptions: Default,
impl<'de> Deserialize<'de> for NormalizeOptionswhere
NormalizeOptions: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NormalizeOptions
Source§impl PartialEq for NormalizeOptions
impl PartialEq for NormalizeOptions
Source§impl Serialize for NormalizeOptions
impl Serialize for NormalizeOptions
impl StructuralPartialEq for NormalizeOptions
Auto Trait Implementations§
impl Freeze for NormalizeOptions
impl RefUnwindSafe for NormalizeOptions
impl Send for NormalizeOptions
impl Sync for NormalizeOptions
impl Unpin for NormalizeOptions
impl UnsafeUnpin for NormalizeOptions
impl UnwindSafe for NormalizeOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.