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:
parent
1d5a755287
commit
248dc0b96a
@ -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__
|
||||
|
||||
Loading…
Reference in New Issue
Block a user