dashes

Function dashes 

Source
pub fn dashes<'a, S: Into<Cow<'a, str>>>(input: S) -> Cow<'a, str>
Expand description

Replace double dashes (--) and triple dashes (---) to en dash and em dash, respectively.

This function can be useful when writing literary texts, but should be used with caution as double and triple dashes can have special meanings.

§Example

use crowbook_text_processing::clean;
let s = clean::dashes("--- Hi, he said -- unexpectedly");
assert_eq!(&s, "— Hi, he said – unexpectedly");