mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-23 03:32:51 +08:00
fix: table title's first letter is getting capitalized by default (#652)
fix for #638
This commit is contained in:
parent
55633b59fa
commit
37f661a963
@ -163,7 +163,7 @@ namespace Spectre.Console
|
|||||||
return Array.Empty<Segment>();
|
return Array.Empty<Segment>();
|
||||||
}
|
}
|
||||||
|
|
||||||
var paragraph = new Markup(header.Text.CapitalizeFirstLetter(), header.Style ?? defaultStyle)
|
var paragraph = new Markup(header.Text, header.Style ?? defaultStyle)
|
||||||
.Alignment(Justify.Center)
|
.Alignment(Justify.Center)
|
||||||
.Overflow(Overflow.Ellipsis);
|
.Overflow(Overflow.Ellipsis);
|
||||||
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
hello world
|
||||||
|
╭────────┬────────┬───────╮
|
||||||
|
│ Foo │ Bar │ Baz │
|
||||||
|
├────────┼────────┼───────┤
|
||||||
|
│ Qux │ Corgi │ Waldo │
|
||||||
|
│ Grault │ Garply │ Fred │
|
||||||
|
╰────────┴────────┴───────╯
|
||||||
|
goodbye world
|
@ -481,6 +481,26 @@ namespace Spectre.Console.Tests.Unit
|
|||||||
return Verifier.Verify(console.Output);
|
return Verifier.Verify(console.Output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Expectation("Render_Title_Caption_LowerCase")]
|
||||||
|
public Task Should_Render_Table_Without_Capitalizing_First_Letter()
|
||||||
|
{
|
||||||
|
// Given
|
||||||
|
var console = new TestConsole();
|
||||||
|
var table = new Table { Border = TableBorder.Rounded };
|
||||||
|
table.Title = new TableTitle("hello world");
|
||||||
|
table.Caption = new TableTitle("goodbye world");
|
||||||
|
table.AddColumns("Foo", "Bar", "Baz");
|
||||||
|
table.AddRow("Qux", "Corgi", "Waldo");
|
||||||
|
table.AddRow("Grault", "Garply", "Fred");
|
||||||
|
|
||||||
|
// When
|
||||||
|
console.Write(table);
|
||||||
|
|
||||||
|
// Then
|
||||||
|
return Verifier.Verify(console.Output);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Expectation("Render_Fold")]
|
[Expectation("Render_Fold")]
|
||||||
public Task Should_Render_With_Folded_Text_Table_Correctly()
|
public Task Should_Render_With_Folded_Text_Table_Correctly()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user