Skip to content

Commit 57c4b79

Browse files
feat: MarkX.ToString flexibility ( Fixes #35 )
1 parent b4a48ad commit 57c4b79

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Types/MarkX/ToString.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1+
if ($args) {
2+
$anyOutput = foreach ($arg in $args) {
3+
$thisArg = $this.$arg
4+
if ($thisArg) {
5+
if ($thisArg.XHTML.InnerXML) {
6+
"$($thisArg.XHTML.InnerXML)" + [Environment]::NewLine
7+
} else {
8+
"$thisArg"
9+
}
10+
}
11+
}
12+
if ($anyOutput) {
13+
return $anyOutput -join [Environment]::NewLine
14+
}
15+
}
16+
117
if (-not $this.XML.XHTML) { return '' }
218
return ("$($this.XML.XHTML.InnerXML)" + [Environment]::NewLine)

0 commit comments

Comments
 (0)