Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="" PrivateAssets="all" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="" PrivateAssets="all" />
<PackageVersion Include="Ionide.ProjInfo" Version="0.74.2" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="Suave" Version="2.6.2" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Memory" Version="4.6.3" />
<PackageVersion Include="System.Text.Json" Version="10.0.5" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageVersion Include="NUnit" Version="4.5.1" />
Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased]

### Changed
* Replace deprecated `System.Net.WebClient` with `System.Net.Http.HttpClient` in the image downloader used by `--saveimages`. Removes the `#nowarn "44"` suppression.
* Bump `Newtonsoft.Json` transitive-dependency pin from 13.0.3 to 13.0.4.
* Bump `System.Memory` transitive-dependency pin from 4.5.5 to 4.6.3.0

### Fixed
* Fix `Markdown.ToMd` silently dropping `EmbedParagraphs` nodes: the serialiser now delegates to the node's `Render()` method and formats the resulting paragraphs, consistent with the HTML and LaTeX back-ends.
* Fix `Markdown.ToMd` dropping link titles in `DirectLink` and `DirectImage` spans. Links with a title attribute (e.g. `[text](url "title")`) now round-trip correctly; without this fix the title was silently discarded on serialisation.
Expand Down
7 changes: 4 additions & 3 deletions src/fsdocs-tool/BuildCommand.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ open System.Diagnostics
open System.IO
open System.Globalization
open System.Net
open System.Net.Http
open System.Reflection
open System.Text

Expand All @@ -29,7 +30,6 @@ open Suave.Filters
open Suave.Logging
open FSharp.Formatting.Markdown

#nowarn "44" // Obsolete WebClient

/// Convert markdown, script and other content into a static site
type internal DocContent
Expand All @@ -48,7 +48,7 @@ type internal DocContent

let createImageSaver (rootOutputFolderAsGiven) =
// Download images so that they can be embedded
let wc = new WebClient()
let http = new HttpClient()
let mutable counter = 0

fun (url: string) ->
Expand All @@ -65,7 +65,8 @@ type internal DocContent

ensureDirectory (sprintf "%s/savedimages" rootOutputFolderAsGiven)
printfn "downloading %s --> %s" url fn
wc.DownloadFile(url, fn)
let bytes = http.GetByteArrayAsync(url).GetAwaiter().GetResult()
File.WriteAllBytes(fn, bytes)
url2
else
url
Expand Down