From ef15a1e2addd72e53809e6a6f464360757f87bab Mon Sep 17 00:00:00 2001 From: "Mr.k" Date: Sun, 23 Jun 2024 21:47:51 +0300 Subject: [PATCH] Add New Escape Character 'Em Dash' to 'Compile.ps1' File MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will Insure that an App Entry can use the '—' Character (aka. the 'Em Dash' Character) in their Content (Title) and Description Fields without any worries. --- Compile.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Compile.ps1 b/Compile.ps1 index 8568e1af..5fdec759 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -48,11 +48,11 @@ Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach- # Note: Avoid using HTML Entity Codes (for example '”' (stands for "Right Double Quotation Mark")), and use HTML decimal/hex codes instead. # as using HTML Entity Codes will result in XML parse Error when running the compiled script. if ($jsonAsObject.$firstLevelName.content -ne $null) { - $jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>') + $jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—') $jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop } if ($jsonAsObject.$firstLevelName.description -ne $null) { - $jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>') + $jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—') $jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop } } @@ -106,4 +106,4 @@ else { } Set-Content -Path $scriptname -Value ($script_content -join "`r`n") -Encoding ascii -Write-Progress -Activity "Compiling" -Completed \ No newline at end of file +Write-Progress -Activity "Compiling" -Completed