Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<#
(## 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
You can’t perform that action at this time.