Skip to content

Commit f8e2670

Browse files
feat: OpenXML.Word.Table.get_Markdown ( Fixes #49 )
1 parent 701b121 commit f8e2670

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<#
2+
.SYNOPSIS
3+
Gets Word Tables as Markdown
4+
.DESCRIPTION
5+
Gets a Word Table in Markdown
6+
#>
7+
8+
$isFirst = $true
9+
@(foreach ($row in $this.tr) {
10+
'|' + (@(
11+
foreach ($column in $row.tc) {
12+
$column.InnerText -replace '(?>\r\n|\n)', '<br/>'
13+
$columnNumber++
14+
}
15+
16+
) -join '|') + '|'
17+
18+
if ($isFirst) {
19+
$isFirst = $false
20+
"|" + ("-|" * ($row.tc.Count))
21+
}
22+
}) -join [Environment]::NewLine

0 commit comments

Comments
 (0)