Skip to content

Latest commit

 

History

History
219 lines (170 loc) · 4.75 KB

Convert-HtmlToMarkdown.md

File metadata and controls

219 lines (170 loc) · 4.75 KB
external help file Module Name online version schema
HtmlToMarkdown.dll-Help.xml
HtmlToMarkdown
2.0.0

Convert-HtmlToMarkdown

SYNOPSIS

Converts HTML to Markdown.

SYNTAX

Convert-HtmlToMarkdown -Html <String> [-DefaultCodeBlockLanguage <String>] [-GithubFlavored]
 [-ListBulletChar <Char>] [-RemoveComments] [-SmartHrefHandling] [-UnknownTags <UnknownTagsOption>]
 [-PassThroughTags <String[]>] [-WhitelistUriSchemes <String[]>]
 [-TableWithoutHeaderRowHandling <TableWithoutHeaderRowHandlingOption>] [<CommonParameters>]

DESCRIPTION

{{ Fill in the Description }}

EXAMPLES

Example 1

'<h1>On Board</h1><ul><li>Ford<li>Zaphod<li>Marvin</ul>' |Convert-HtmlToMarkdown
# On Board

- Ford
- Zaphod
- Marvin

Example 2

Invoke-RestMethod https://google.com/ |Convert-HtmlToCommonMark -UnknownTags Bypass
1. [Search](https://www.google.com/webhp?tab=ww)
2. [Images](https://www.google.com/imghp?hl=en&tab=wi)
3. [Maps](https://maps.google.com/maps?hl=en&tab=wl)
...

PARAMETERS

-DefaultCodeBlockLanguage

Option to set the default code block language for Github style markdown if class based language markers are not available.

Type: String
Parameter Sets: (All)
Aliases: CodeDefault

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-GithubFlavored

Github style markdown for br, pre and table.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: GFM

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Html

HTML to convert.

Type: String
Parameter Sets: (All)
Aliases: InputObject, OuterHtml

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-ListBulletChar

Sets the bullet character to use for unordered lists.

Type: Char
Parameter Sets: (All)
Aliases: Bullets

Required: False
Position: Named
Default value: '-'
Accept pipeline input: False
Accept wildcard characters: False

-PassThroughTags

Pass a list of tags to pass through as-is without any processing.

Type: String[]
Parameter Sets: (All)
Aliases: PassThroughElements, KeepTags, KeepElements

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-RemoveComments

Remove comment tags with text.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: StripComments

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SmartHrefHandling

Outputs link as auto-linking text (not an explicit link) when the text matches the link.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: AutoLink

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TableWithoutHeaderRowHandling

What to do about tables without a header row. Default: first row will be used as header row. EmptyRow: an empty header row is created.

Type: TableWithoutHeaderRowHandlingOption
Parameter Sets: (All)
Aliases: TableHeaderDefault
Accepted values: Default, EmptyRow

Required: False
Position: Named
Default value: Default
Accept pipeline input: False
Accept wildcard characters: False

-UnknownTags

What to do with unknown tags: PassThrough includes it as is, Drop removes it, Bypass ignores it, and Raise throws an exception.

Type: UnknownTagsOption
Parameter Sets: (All)
Aliases: UnknownElements
Accepted values: PassThrough, Drop, Bypass, Raise

Required: False
Position: Named
Default value: PassThrough
Accept pipeline input: False
Accept wildcard characters: False

-WhitelistUriSchemes

Specify which schemes (without trailing colon) are to be allowed for links and images. Empty string allows unknown schemes.

Type: String[]
Parameter Sets: (All)
Aliases: AllowlistUriSchemes

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.String

OUTPUTS

System.String

NOTES

RELATED LINKS