crabmail

Static HTML email archive viewer in Rust
git clone git://git.alexwennerberg.com/crabmail
Log | Files | Refs | README | LICENSE

commit 9d1b8243d86e2ccbd21de5f91fa14a848cdebfca
parent 30f91a66dbf5bc4207743c44ddfb740d43c1a29d
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 16 May 2021 19:05:48 -0700

remove ' escape

Diffstat:
Msrc/utils.rs | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/utils.rs b/src/utils.rs @@ -1,7 +1,7 @@ use std::io; use std::io::Write; // Derived from https://github.com/raphlinus/pulldown-cmark/blob/master/src/escape.rs -// Added ' escape +// Don't use single quotes (') in any of my attributes // !!!WIP!!! -- still need to add tests, audit security, etc const fn create_html_escape_table() -> [u8; 256] { @@ -10,13 +10,12 @@ const fn create_html_escape_table() -> [u8; 256] { table[b'&' as usize] = 2; table[b'<' as usize] = 3; table[b'>' as usize] = 4; - table[b'\'' as usize] = 5; table } static HTML_ESCAPE_TABLE: [u8; 256] = create_html_escape_table(); -static HTML_ESCAPES: [&str; 6] = ["", "&quot;", "&amp;", "&lt;", "&gt;", "&#39"]; +static HTML_ESCAPES: [&str; 5] = ["", "&quot;", "&amp;", "&lt;", "&gt;"]; fn escape_html(mut w: String, s: &str) { let bytes = s.as_bytes();