Skip to main content

text

Function text 

Source
pub fn text(html: &str) -> String
Expand description

The text a reader sees in html, with a line break after each block: a summary, a search index or a word count.

use tablo_core::rich_text::text;

assert_eq!(
    text("<h2>Tea &amp; cake</h2><p>Two <em>slices</em></p>"),
    "Tea & cake\nTwo slices"
);