Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageVersion Include="ICSharpCode.Decompiler" Version="9.1.0.7988" />
<PackageVersion Include="Jint" Version="4.16.2" />
<PackageVersion Include="JsonSchema.Net" Version="[8.0.5]" />
<PackageVersion Include="Markdig" Version="1.3.2" />
<PackageVersion Include="Markdig" Version="1.4.0" />
<PackageVersion Include="Microsoft.Playwright" Version="1.62.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="OneOf" Version="3.0.271" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,65 @@ public void PipeTableTest_Default()
TestUtility.VerifyMarkup(content, expected, optionalExtensions: ["PipeTables"]);
}

[Theory]
[InlineData("||---|---|")]
[InlineData("|---||---|")]
[InlineData("|---|---||")]
[InlineData("| --- | | --- |")]
[InlineData("| | --- | |")]
public void PipeTableTest_PartiallyEmptySeparator(string separator)
{
var content =
$"""
| a | b | c |
{separator}
| 0 | 1 | 2 |
""";

var expected =
"""
<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>1</td>
<td>2</td>
</tr>
</tbody>
</table>
""";

TestUtility.VerifyMarkup(content, expected);
TestUtility.VerifyMarkup(content, expected, optionalExtensions: ["PipeTables"]);
TestUtility.VerifyMarkup(content, expected, optionalExtensions: ["gfm-pipetables"]);
}

[Theory]
[InlineData("||||")]
[InlineData("| | | |")]
public void PipeTableTest_EmptySeparatorIsNotTable(string separator)
{
var content =
$"""
| a | b | c |
{separator}
| 0 | 1 | 2 |
""";

var expected = $"<p>{content}</p>";

TestUtility.VerifyMarkup(content, expected);
TestUtility.VerifyMarkup(content, expected, optionalExtensions: ["PipeTables"]);
TestUtility.VerifyMarkup(content, expected, optionalExtensions: ["gfm-pipetables"]);
}

[Fact]
public void PipeTableTest_Custom()
{
Expand Down
Loading