diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index db104a87d..cc2db45bf 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -2,6 +2,9 @@ ## [Unreleased] +### Changed +* Replace `sprintf "
"` (a format string with no format arguments) with the plain string literal `"
"` in `HtmlFormatting.fs`. This is on the hot path invoked once per rendered code/output block, and avoids the unnecessary printf-format parsing overhead for a string with no substitutions.
+
 ### Removed
 * Remove `docs/Dockerfile` (used for mybinder.org Binder integration) and mybinder badge links from documentation pages. The Binder integration relied on a deprecated .NET 7 SDK image and a deprecated `Microsoft.dotnet-interactive` version; mybinder.org support is discontinued.
 * Remove `.ipynb` (Jupyter Notebook) "run in notebook" badge links from all documentation pages and delete `docs/img/badge-notebook.svg`. The links linked to `.ipynb` outputs generated by fsdocs, but .NET Interactive (which powered those notebooks) is deprecated and has no current replacement. The `.ipynb` output format itself is unchanged.
diff --git a/src/FSharp.Formatting.Markdown/HtmlFormatting.fs b/src/FSharp.Formatting.Markdown/HtmlFormatting.fs
index 0a2f56d25..0f32082fe 100644
--- a/src/FSharp.Formatting.Markdown/HtmlFormatting.fs
+++ b/src/FSharp.Formatting.Markdown/HtmlFormatting.fs
@@ -203,7 +203,7 @@ let rec internal formatParagraph (ctx: FormattingContext) paragraph =
             ctx.Writer.Write("
") if String.IsNullOrWhiteSpace(language) then - ctx.Writer.Write(sprintf "
")
+            ctx.Writer.Write("
")
         else
             let langCode = sprintf "language-%s" (htmlEncodeQuotes language)
             ctx.Writer.Write(sprintf "
" langCode)
@@ -218,7 +218,7 @@ let rec internal formatParagraph (ctx: FormattingContext) paragraph =
         if ctx.WrapCodeSnippets then
             ctx.Writer.Write("
") - ctx.Writer.Write(sprintf "
")
+        ctx.Writer.Write("
")
         ctx.Writer.Write(htmlEncode code)
         ctx.Writer.Write("
") @@ -315,7 +315,7 @@ let rec internal formatParagraph (ctx: FormattingContext) paragraph = if ctx.WrapCodeSnippets then ctx.Writer.Write("
") - ctx.Writer.Write(sprintf "
")
+        ctx.Writer.Write("
")
 
         for (code, _) in lines do
             ctx.Writer.Write(htmlEncode code)