Function crowbook_text_processing::clean::typographic_quotes
[−]
[src]
pub fn typographic_quotes<'a, S: Into<Cow<'a, str>>>(input: S) -> Cow<'a, str>
Replace quotes with more typographic variants
While it should work pretty well for double quotes ("
), the rules for single
quote ('
) are more ambiguous, as it can be a quote, or an apostrophe and it's not
that easy to get right.
Example
use crowbook_text_processing::typographic_quotes; let s = typographic_quotes("\"foo\""); assert_eq!(&s, "“foo”"); let s = typographic_quotes("'foo'"); assert_eq!(&s, "‘foo’");