Supply metadata.content_type for to html output (#14990)

# Description

Adds pipeline metadata to the `to html` command output (hardcoded to
`text/html; charset=utf-8`)

# User-Facing Changes

Pipeline metadata is now included with the `to html` command output.
This commit is contained in:
Bruce Weirdan
2025-02-03 13:32:57 +01:00
committed by GitHub
parent 8b431e3a2e
commit 4424481487
4 changed files with 18 additions and 2 deletions

View File

@ -14,6 +14,15 @@ fn out_html_simple() {
);
}
#[test]
fn out_html_metadata() {
let actual = nu!(r#"
echo 3 | to html | metadata | get content_type
"#);
assert_eq!(actual.out, r#"text/html; charset=utf-8"#);
}
#[test]
fn out_html_partial() {
let actual = nu!(r#"