Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Change generated HTML encoding to UTF-8N (without BOM) #10069

Merged
merged 2 commits into from
Oct 19, 2024
Merged
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: 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 @@ -79,7 +81,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