diff --git a/src/print/mod.rs b/src/print/mod.rs index 61196722..2c641e4c 100644 --- a/src/print/mod.rs +++ b/src/print/mod.rs @@ -252,6 +252,12 @@ fn is_numeric(v: &Value) -> bool { fn to_cell(prn: &mut Printer<&mut String>, v: &Option) -> table::Cell { match v { + Some(Value::Str(s)) => { + let s = native::format_string(s, prn.expand_strings()); + prn.const_string(&s[1..s.len() - 1]) + .unwrap_exc() + .unwrap_infallible() + } Some(vi) => vi.format(prn).unwrap_exc().unwrap_infallible(), None => {} }; diff --git a/src/print/native.rs b/src/print/native.rs index 7826847c..4bccc55b 100644 --- a/src/print/native.rs +++ b/src/print/native.rs @@ -13,7 +13,7 @@ pub trait FormatExt { fn format(&self, prn: &mut F) -> Result; } -fn format_string(s: &str, expanded: bool) -> String { +pub fn format_string(s: &str, expanded: bool) -> String { let mut buf = String::with_capacity(s.len() + 2); buf.push('\''); for c in s.chars() {