From 8f641320ab74444cfc4b6b83678251f1806cc3c3 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 ca40793dfa6..6267d4d1b2b 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__