diff --git a/Core.psm1 b/Core.psm1 index 64beb69..eb279b8 100644 --- a/Core.psm1 +++ b/Core.psm1 @@ -2765,11 +2765,11 @@ function Update-XmlFormatting { ) process { - # 1. Fix empty xml elements → instead of + $Xml = $Xml -replace "`r`n", "`n" + $Xml = $Xml -replace '<([^\s/>]+)([^>]*)\s/>' , '<$1$2/>' - # 2. Remove empty lines (lines containing only whitespace or nothing) - $Xml = ($Xml -split "`r?`n") | + $Xml = ($Xml -split "`n") | Where-Object { $_.Trim().Length -gt 0 } | ForEach-Object { $_ } | Out-String