pub struct TextMap {
pub nodes: Vec<TextNode>,
pub title: String,
}Available on crate feature
text-map only.Expand description
Result of extract_text_nodes: an ordered list of content text nodes
with the page title.
Pass nodes (or a subset) to replace_text_nodes to
rewrite the HTML while keeping all markup intact.
§Example
let map = webshift::extract_text_nodes("<p>Hello <strong>world</strong></p>");
assert_eq!(map.nodes[0].text, "Hello");
assert_eq!(map.nodes[1].text, "world");Fields§
§nodes: Vec<TextNode>Ordered list of text nodes found outside noise elements (<script>,
<style>, <nav>, <footer>, <header>, <aside>, <form>,
<iframe>, <noscript>, <svg>, <button>, <input>, <select>,
<textarea>, <head>).
title: StringPage title extracted from <title>, or an empty string if absent.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextMap
impl RefUnwindSafe for TextMap
impl Send for TextMap
impl Sync for TextMap
impl Unpin for TextMap
impl UnsafeUnpin for TextMap
impl UnwindSafe for TextMap
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