diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/generate_html.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/generate_html.rs b/src/generate_html.rs index 6909871..36f3325 100644 --- a/src/generate_html.rs +++ b/src/generate_html.rs @@ -468,6 +468,8 @@ fn sanitize_text(text: &str, fancy: bool) -> String { true => chars[i + 1], false => ' ', }; + let is_whitespace = |c: char| c.is_whitespace() || "()[].,".contains(c); + match c { '&' => { // The HTML syntax for unicode characters is � @@ -477,14 +479,14 @@ fn sanitize_text(text: &str, fancy: bool) -> String { '<' => output.push_str("<"), '>' => output.push_str(">"), '"' => match fancy { - true => match prev.is_whitespace() { + true => match is_whitespace(prev) { true => output.push('“'), false => output.push('”'), } false => output.push_str("""), }, '\'' => match fancy { - true => match prev.is_whitespace() { + true => match is_whitespace(prev) { true => output.push('‘'), false => output.push('’'), } |
