File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222 defaults to ` $true ` .
2323 - ` Clean_WikiContent_For_GitHub_Publish ` - This task will remove the top
2424 level header from any markdown file where the top level header equals the
25- filename (converting Unicode hyphen to ASCII hyphen before comparison).
26- It can be controlled by parameter ` RemoveTopLevelHeader ` in the task, which
27- defaults to ` $true ` .
25+ filename. The task will convert standard hyphens to spaces and Unicode
26+ hyphens to standard hyphens before comparison. The task can be controlled
27+ by parameter ` RemoveTopLevelHeader ` in the task, which defaults to ` $true ` .
2828
2929### Changed
3030
Original file line number Diff line number Diff line change @@ -113,9 +113,10 @@ Task Clean_WikiContent_For_GitHub_Publish {
113113
114114 $hasTopHeader = $content -match ' (?m)^#\s+([^\r\n]+)'
115115
116- $baseNameWithoutNonBreakingHyphen = $_.BaseName -replace [System.Char ]::ConvertFromUtf32(0x2011 ), ' -'
116+ $convertedBaseName = $_.BaseName -replace ' -' , ' '
117+ $convertedBaseName = $convertedBaseName -replace [System.Char ]::ConvertFromUtf32(0x2011 ), ' -'
117118
118- if ($hasTopHeader -and $Matches [1 ] -eq $baseNameWithoutNonBreakingHyphen )
119+ if ($hasTopHeader -and $Matches [1 ] -eq $convertedBaseName )
119120 {
120121 Write-Build - Color DarkGray - Text (' Top level header is the same as the filename. Removing top level header from: {0}' -f $_.Name )
121122
Original file line number Diff line number Diff line change @@ -35,9 +35,14 @@ Describe 'Clean_WikiContent_For_GitHub_Publish' {
3535
3636 New-Item - Path " $ ( $TestDrive.FullName ) /WikiContent" - ItemType ' Directory' - Force | Out-Null
3737
38- Set-Content - Path " $ ( $TestDrive.FullName ) /WikiContent/Get-Something.md" - Value ' Mock markdown file 1'
38+ # Will not be modified
39+ Set-Content - Path " $ ( $TestDrive.FullName ) /WikiContent/Get-Something.md" - Value ' # Get-Something`nMock markdown file 1'
3940
40- Set-Content - Path " $ ( $TestDrive.FullName ) /WikiContent/home.md" - Value ' Mock markdown file 1'
41+ # Will be modified
42+ Set-Content - Path " $ ( $TestDrive.FullName ) /WikiContent/Credential-overview.md" - Value " # Credential overview`n Mock markdown file 3"
43+
44+ # Will not be modified
45+ Set-Content - Path " $ ( $TestDrive.FullName ) /WikiContent/Home.md" - Value " # My Module Name`n Mock markdown file 4"
4146 }
4247
4348 It ' Should export the build script alias' {
You can’t perform that action at this time.
0 commit comments