mirror of
https://github.com/denoland/deno.git
synced 2024-12-02 17:01:14 -05:00
fix(task): handle carriage return in task description (#27099)
Ref https://github.com/denoland/deno/pull/27069#discussion_r1857702814
This commit is contained in:
parent
e2f7e031b3
commit
4700f12ddc
3 changed files with 9 additions and 1 deletions
|
@ -721,7 +721,7 @@ fn print_available_tasks(
|
|||
)?;
|
||||
if let Some(description) = &desc.task.description {
|
||||
let slash_slash = colors::italic_gray("//");
|
||||
for line in description.split('\n') {
|
||||
for line in description.lines() {
|
||||
writeln!(writer, " {slash_slash} {}", colors::italic_gray(line))?;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
"multiline_description": {
|
||||
"description": "This is a multiline\ndescription",
|
||||
"command": "echo 2"
|
||||
},
|
||||
"multiline_description_carriage_return": {
|
||||
"description": "This is a multiline\r\ndescription\r\n",
|
||||
"command": "echo 3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,3 +6,7 @@ Available tasks:
|
|||
// This is a multiline
|
||||
// description
|
||||
echo 2
|
||||
- multiline_description_carriage_return
|
||||
// This is a multiline
|
||||
// description
|
||||
echo 3
|
||||
|
|
Loading…
Reference in a new issue