Add pretty flag to to md (#2640)

* First draft for adding a `pretty` flag to `to md`

* rustfmt

* Fix Clippy warnings

* rustfmt

* Using Clippy suggestion broken code, reverting and putting in a statement to ignore clippy warning

* Add test for `to md -p`
This commit is contained in:
Joseph T. Lyons
2020-10-14 23:20:55 -04:00
committed by GitHub
parent a2cc2259e7
commit bf2363947b
4 changed files with 171 additions and 12 deletions

View File

@ -23,3 +23,15 @@ fn out_md_table() {
assert_eq!(actual.out, "|name||-||jason|");
}
#[test]
fn out_md_table_pretty() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo '{"name": "joseph"}' | from json | to md -p
"#
));
assert_eq!(actual.out, "|name ||------||joseph|");
}