Skip to content

Commit

Permalink
Updating EZOut tests (re #69)
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating authored and StartAutomating committed Sep 12, 2022
1 parent a778e38 commit 67c20f6
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions EZOut.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ if ($Request -or $Host.UI.SupportsHTML) {
#>
[Management.Automation.Cmdlet("Format","Object")]
[ValidateScript({return $true})]
param(
param(
[Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName)]
[PSObject]
$InputObject,
Expand Down Expand Up @@ -1434,7 +1434,10 @@ if ($Request -or $Host.UI.SupportsHTML) {
'```' + # Start the code fence,
$(if ($CodeLanguage) { $CodeLanguage}) + # add the language,
[Environment]::newline + # then a newline,
$(if ($ScriptBlock) { "$scriptBlock" } else { $inputObject | LinkInput}) + # then the -ScriptBlock or -InputObject
$(
$codeContent = $(if ($ScriptBlock) { "$scriptBlock" } else { $inputObject | LinkInput}) # then the -ScriptBlock or -InputObject
[Web.HttpUtility]::HtmlEncode($codeContent)
) +
[Environment]::newline + # then a newline
'```' # then close the code fence.
)
Expand All @@ -1452,7 +1455,7 @@ if ($Request -or $Host.UI.SupportsHTML) {
}
elseif ($BlockQuote -or $BlockQuoteDepth) {
if (-not $BlockQuoteDepth) { $BlockQuoteDepth = 1 }
$markdownLines += (">" * $BlockQuoteDepth) + ' ' + (
$markdownLines += (">" * $BlockQuoteDepth ) + ' ' + (
"$inputObject" -split '(?>\r\n|\n)' -join (
[Environment]::NewLine + (">" * $BlockQuoteDepth) + ' '
)
Expand Down Expand Up @@ -1577,13 +1580,19 @@ if ($Request -or $Host.UI.SupportsHTML) {
}

# Now we create the row for this object.
$markdownLines += '|' + (@(foreach ($prop in $propertyList) {
if ($prop -is [string]) {
$in.$prop | LinkInput
} else {
$prop.Value | LinkInput
}
}) -replace ([Environment]::newline), '<br/>' -replace '\|', '`|' -join '|') + '|'

$markdownLine = '|' + (
@(
foreach ($prop in $propertyList) {
if ($prop -is [string]) {
$in.$prop | LinkInput
} else {
$prop.Value | LinkInput
}
}
) -replace ([Environment]::newline), '<br/>' -replace '\|', '`|' -join '|') + '|'

$markdownLines += $markdownLine
}
}

Expand Down

0 comments on commit 67c20f6

Please sign in to comment.