Last active
October 19, 2019 21:55
-
-
Save techthoughts2/ace1e18fad6b0f13c87032eee3df4e3a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
(## EXAMPLE [^`]*)(```\r\n)([^`]*)(```\r\n)(\r\n)([^#]*)(\r\n\r\n)+([^#]+)(#) | |
(## EXAMPLE [^`]+?```\r\n[^`\r\n]+?\r\n)(```\r\n\r\n)([^#]+?\r\n)(\r\n) | |
(## EXAMPLE [^`]+?```\r\n[^`\r\n]+?\r\n)(```\r\n\r\n)([^#]+?\r\n)(\r\n)([^#]+)(#) | |
#> | |
New-MarkdownHelp -Module MyModuleToDocument -OutputFolder $OutputDir -Force | |
$OutputDir | Get-ChildItem -File | ForEach-Object { | |
# fix formatting in multiline examples | |
$content = Get-Content $_.FullName -Raw | |
$newContent = $content -replace '(## EXAMPLE [^`]*)(```\r\n)([^`]*)(```\r\n)(\r\n)([^#]*)(\r\n\r\n)+([^#]+)(#)', '$1$2$3$6$5$4$7$8$9' | |
if ($newContent -ne $content) { | |
Set-Content -Path $_.FullName -Value $newContent -Force | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment