diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/generate_html.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/generate_html.rs b/src/generate_html.rs index 0e6ce75..467feeb 100644 --- a/src/generate_html.rs +++ b/src/generate_html.rs @@ -342,11 +342,12 @@ pub fn document_to_html(page: &Page, website: &Website) -> String { for section in &table.sections { wrap!("tbody", for row in section { wrap!("tr", for (column, cell) in std::iter::zip(&table.columns, row) { - let text_raw = line_to_html!(cell); - let text = match text_raw.as_str() { - "Yes" => "✓", - "No" => "✗", - other => other, + let text_raw = line_to_html!(cell).trim().to_string(); + let text_cmp = text_raw.to_lowercase().to_string(); + let text = match text_cmp.as_str() { + "yes" => "✓", + "no" => "✗", + _ => &text_raw, }; let mut class = match text { "--" => "c", @@ -356,7 +357,7 @@ pub fn document_to_html(page: &Page, website: &Website) -> String { Alignment::Right => "r", }, }.to_string(); - if ["No", "--", "0"].contains(&text_raw.as_str()) { + if ["no", "--", "0"].contains(&text_cmp.as_str()) { class.push_str(" dim"); }; if column.border_right { |
