diff options
-rw-r--r-- | askama_shared/src/escaping.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/askama_shared/src/escaping.rs b/askama_shared/src/escaping.rs index e22e0ce..93545fd 100644 --- a/askama_shared/src/escaping.rs +++ b/askama_shared/src/escaping.rs @@ -96,7 +96,7 @@ pub fn escape(s: String) -> String { _ => panic!("incorrect indexing"), } } - if start < bytes.len() - 1 { + if start < bytes.len() { res.extend(&bytes[start..]); } @@ -112,5 +112,6 @@ mod tests { assert_eq!(escape("<&>".to_string()), "<&>"); assert_eq!(escape("bla&".to_string()), "bla&"); assert_eq!(escape("<foo".to_string()), "<foo"); + assert_eq!(escape("bla&h".to_string()), "bla&h"); } } |