Skip to content

Commit fe3c77f

Browse files
🩹 [Patch]: Remove escaping of special markdown compliant characters (#39)
## Description - Remove escaping (\) of special characters in doc files that are compliant with markdown formatting: - '`' - '[' - ']' - '<' - '>' - '\\' ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent f53f0d6 commit fe3c77f

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

scripts/helpers/Build/Build-PSModuleDocumentation.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,29 @@ function Build-PSModuleDocumentation {
4141
$fixedOpening = $true
4242
} elseif ($line -match '^```.+$') {
4343
$fixedOpening = $true
44-
} elseif ($line -match '^```$'){
44+
} elseif ($line -match '^```$') {
4545
$fixedOpening = $false
4646
}
4747
$newContent += $line
4848
}
4949
$newContent | Set-Content -Path $_.FullName
5050
}
51+
Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object {
52+
$content = Get-Content -Path $_.FullName -Raw
53+
$content = $content -replace '\\`', '`'
54+
$content = $content -replace '\\\[', '['
55+
$content = $content -replace '\\\]', ']'
56+
$content = $content -replace '\\\<', '<'
57+
$content = $content -replace '\\\>', '>'
58+
$content = $content -replace '\\\\', '\'
59+
$content | Set-Content -Path $_.FullName
60+
}
5161
Stop-LogGroup
5262

5363
Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object {
5464
$fileName = $_.Name
5565
$hash = (Get-FileHash -Path $_.FullName -Algorithm SHA256).Hash
56-
Start-LogGroup "- File: [$fileName] - [$hash]"
66+
Start-LogGroup " - [$fileName] - [$hash]"
5767
Show-FileContent -Path $_
5868
Stop-LogGroup
5969
}

tests/src/PSModuleTest/public/New-PSModuleTest.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ function New-PSModuleTest {
99
Test-PSModule -Name 'World'
1010
1111
"Hello, World!"
12+
13+
.NOTES
14+
Testing if a module can have a [Markdown based link](https://example.com).
15+
!"#¤%&/()=?`´^¨*'-_+§½{[]}<>|@£$€¥¢:;.,"
16+
\[This is a test\]
1217
#>
1318
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
1419
'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function',

0 commit comments

Comments
 (0)