Parse MD files coming over http as raw markdown files (#2168)

This will allow us to point our verify-link script at a raw
MD file in a github repo and have it parsed correctly for
links.

Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
This commit is contained in:
Azure SDK Bot 2021-04-28 13:41:26 -07:00 committed by GitHub
parent 1d5a755287
commit 248dc0b96a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -330,6 +330,10 @@ function GetLinks([System.Uri]$pageUri)
try {
$response = Invoke-WebRequest -Uri $pageUri -UserAgent $userAgent
$content = $response.Content
if ($pageUri.ToString().EndsWith(".md")) {
$content = (ConvertFrom-MarkDown -InputObject $content).html
}
}
catch {
$statusCode = $_.Exception.Response.StatusCode.value__