[][src]Function gen_epub_book::util::write_string_content

pub fn write_string_content<W: Write>(
    to: &mut W,
    ctnt: &str
) -> Result<(), Error>

Write the string content in an acceptable form.

Examples

let mut buf = vec![];
assert_eq!(write_string_content(&mut buf, "<i>String content</i>"), Ok(()));
assert_eq!(&buf.iter().map(|&i| i as char).collect::<String>(),
r#"<html xmlns="http://www.w3.org/1999/xhtml">
  <head></head>
  <body>
    <i>String content</i>
  </body>
</html>
"#);