Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed Aug 7, 2020
1 parent 425f869 commit e29129e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Public/ConvertFrom-HTMLtoMarkdown.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
function ConvertFrom-HTMLToMarkdown {
[cmdletBinding()]
param(

[string] $Path,
[string] $DestinationPath,
[ReverseMarkdown.Config+UnknownTagsOption] $UnknownTags = [ReverseMarkdown.Config+UnknownTagsOption]::Drop,
[switch] $GithubFlavored
)
if ($Path -and (Test-Path -Path $Path)) {
$Content = Get-Content -Path $Path

$Converter = [ReverseMarkdown.Converter]::new()
$Converter.Config.UnknownTags = $UnknownTags
$Converter.Config.GithubFlavored = $GithubFlavored.IsPresent
$ContentMD = $Converter.Convert($Content)
$ContentMD | Out-File -FilePath $DestinationPath
}
}

0 comments on commit e29129e

Please sign in to comment.