更新 : 2020-05-22

https://stackoverflow.com/questions/36866057/c-sharp-tool-that-formats-an-html-string-before-sending-it-to-the-client

手动调用 mini html 也是 ok 的

然后发现, whitespace 无法 clear 掉 span new line 这种情况. 

https://css-tricks.com/fighting-the-space-between-inline-block-elements/

span new line 会有 space, 但是这个是 html 的设计啦,不 clear 因为这样比较安全, 不会因为 mini 而破坏最终的呈现.

 

 

 

更新 : 2019-05-04 

补上一个完整的 startup.cs 

public class Startup
{
    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public IConfiguration Configuration { get; }

    public void ConfigureServices(IServiceCollection services)
    {
        var fileExtensionContentTypeProvider = new FileExtensionContentTypeProvider();
        fileExtensionContentTypeProvider.Mappings[".webmanifest"] = "application/manifest+json";
        services.AddSingleton<IContentTypeProvider>(fileExtensionContentTypeProvider);
        services.Configure<RewriteOptions>(options =>
        {
            options.AddRedirectToWww();
        });
        services.Configure<RewriteOptions>(options =>
        {
            options.AddRedirectToHttps();
        });
        services.AddResponseCompression(options => {
            options.EnableForHttps = true;
        });
        services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
    }

    public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider)
    {
        app.UseRewriter();
        app.UseResponseCompression();

        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseExceptionHandler("/Error");
        }

        app.UseStaticFiles(new StaticFileOptions
        {
            ContentTypeProvider = serviceProvider.GetService<IContentTypeProvider>(),
            OnPrepareResponse = ctx =>
            {
                if (!env.IsDevelopment())
                {
                    var cachePeriod = TimeSpan.FromDays(365 * 15).TotalSeconds.ToString();
                    ctx.Context.Response.Headers.Append("Cache-Control", $"public, max-age={cachePeriod}");
                }
            }
        });
        app.UseMvc();
    }
}
View Code

相关文章:

  • 2021-11-24
  • 2022-02-06
  • 2021-05-20
  • 2022-02-15
  • 2021-10-01
  • 2022-01-04
  • 2021-09-11
  • 2021-07-20
猜你喜欢
  • 2021-06-16
  • 2021-08-09
  • 2021-08-27
  • 2021-11-29
  • 2021-05-11
  • 2021-06-22
相关资源
相似解决方案