Skip to content

Commit

Permalink
BREAKING CHANGE: Change generated HTML encoding to UTF-8N (without BO…
Browse files Browse the repository at this point in the history
…M) (#10069)

chore: change generated HTML encoding to UTF-8 without BOM
  • Loading branch information
filzrev authored Oct 19, 2024
1 parent 59ff064 commit 6b52636
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Docfx.Build/PostProcessors/HtmlPostProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace Docfx.Build.Engine;

sealed class HtmlPostProcessor : IPostProcessor
{
private static readonly UTF8Encoding Utf8EncodingWithoutBom = new(false);

public List<IHtmlDocumentHandler> Handlers { get; } = new();

private bool _handlerInitialized;
Expand Down Expand Up @@ -81,7 +83,7 @@ where output.Key.Equals(".html", StringComparison.OrdinalIgnoreCase)
}
using (var stream = EnvironmentContext.FileAbstractLayer.Create(tuple.OutputFile))
{
document.Save(stream, Encoding.UTF8);
document.Save(stream, Utf8EncodingWithoutBom);
}
}
foreach (var handler in Handlers)
Expand Down

0 comments on commit 6b52636

Please sign in to comment.