diff --git a/.github/actions/bootstrap/action.yml b/.github/actions/bootstrap/action.yml index a468540be..5b9171639 100644 --- a/.github/actions/bootstrap/action.yml +++ b/.github/actions/bootstrap/action.yml @@ -20,6 +20,7 @@ runs: git tag --list - uses: actions/setup-dotnet@v4 with: + dotnet-version: 9.0.100 global-json-file: global.json - id: dotnet @@ -37,4 +38,3 @@ runs: cache: npm cache-dependency-path: src/Elastic.Markdown/package-lock.json node-version-file: .nvmrc - \ No newline at end of file diff --git a/global.json b/global.json index 00b67caef..41c9ad2ed 100644 --- a/global.json +++ b/global.json @@ -4,4 +4,4 @@ "rollForward": "latestFeature", "allowPrerelease": false } -} \ No newline at end of file +} diff --git a/tests/authoring/Framework/HtmlAssertions.fs b/tests/authoring/Framework/HtmlAssertions.fs index cad73f592..087f6698c 100644 --- a/tests/authoring/Framework/HtmlAssertions.fs +++ b/tests/authoring/Framework/HtmlAssertions.fs @@ -86,11 +86,19 @@ actual: {actual} let private prettyHtml (html:string) (querySelector: string option) = let parser = HtmlParser() let document = parser.ParseDocument(html) + + let elementOpt: IElement option = + match querySelector with + | Some q -> Option.ofObj (document.QuerySelector q) + // IHtmlBodyElement implements IElement. document.Body returns IHtmlBodyElement? + // Option.ofObj will handle if document.Body is null (though unlikely for valid HTML documents) + | None -> Option.ofObj (document.Body :> IElement) + + let element = match querySelector with | Some q -> document.QuerySelector q | None -> document.Body - let links = element.QuerySelectorAll("a") links |> Seq.iter(fun l ->