File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
tests/authoring/Framework Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "sdk" : {
3- "version" : " 9.0.100 " ,
3+ "version" : " 9.0.204 " ,
44 "rollForward" : " latestFeature" ,
55 "allowPrerelease" : false
66 }
7- }
7+ }
Original file line number Diff line number Diff line change @@ -86,11 +86,19 @@ actual: {actual}
8686 let private prettyHtml ( html : string ) ( querySelector : string option ) =
8787 let parser = HtmlParser()
8888 let document = parser.ParseDocument( html)
89+
90+ let elementOpt : IElement option =
91+ match querySelector with
92+ | Some q -> Option.ofObj ( document.QuerySelector q)
93+ // IHtmlBodyElement implements IElement. document.Body returns IHtmlBodyElement?
94+ // Option.ofObj will handle if document.Body is null (though unlikely for valid HTML documents)
95+ | None -> Option.ofObj ( document.Body :> IElement)
96+
97+
8998 let element =
9099 match querySelector with
91100 | Some q -> document.QuerySelector q
92101 | None -> document.Body
93-
94102 let links = element.QuerySelectorAll( " a" )
95103 links
96104 |> Seq.iter( fun l ->
You can’t perform that action at this time.
0 commit comments