fix: Make escape more conforming
Also fix formatting
@@ -19,6 +19,9 @@ fn nr_escaped(text: &str) -> usize {
// https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/escape.rs
// Retrieved 2016-11-19.
fn escape(input: &Value, once_p: bool) -> Result<Value> {
+ if input.is_nil() {
+ return Ok(Value::nil());
+ }
let s = input.to_str();
let mut result = String::new();
let mut last = 0;
