From bc20f737fd9ed211ec1c64cf2d340d8f1e8ef4c9 Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Wed, 28 Apr 2021 09:05:56 -0700 Subject: [PATCH] Parse MD files coming over http as raw markdown files 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. --- eng/common/scripts/Verify-Links.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/common/scripts/Verify-Links.ps1 b/eng/common/scripts/Verify-Links.ps1 index ca40793df..6267d4d1b 100644 --- a/eng/common/scripts/Verify-Links.ps1 +++ b/eng/common/scripts/Verify-Links.ps1 @@ -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__