Taritsyn / WebMarkupMin

The Web Markup Minifier (abbreviated WebMarkupMin) - a .NET library that contains a set of markup minifiers. The objective of this project is to improve the performance of web applications by reducing the size of HTML, XHTML and XML code.
Apache License 2.0
449 stars 48 forks source link

WebMarkupMin.AspNet4.Mvc: Appear a strange string and disorder html tags #4

Closed fioenix closed 8 years ago

fioenix commented 8 years ago

Please help me,

I use WebMarkupMin.AspNet4.Mvc with default configurations.

After the browser rendered, the position of html tags disordered:

screenshot_1

Taritsyn commented 8 years ago

Hello, Fioenix!

Give an example of a HTML code before minification.

Taritsyn commented 8 years ago

I'm closing this error, because didn't get example of the HTML code before minification.

fioenix commented 8 years ago

Sorry, I'm late.

This is HTML code file.

Thanks & regards.

Internet Tivi Sony 40 inch KDL-40W700C.txt

Taritsyn commented 8 years ago

Hello, Fioenix!

Did you tested this file? I have not found any "&#65279" strings in minified HTML code.

Why source file contains the following code:

<!-- saved from url=(0044)http://www.dmx.com/tivi/led-sony-kdl-40w700c -->

You saved it by using the browser? When saving an HTML document in this way, browser modifies its source code.

In addition, encoding declared 2 times:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
Taritsyn commented 8 years ago

What version of the WebMarkupMin.Core are you using?

HTML entity &#65279 is BOM. In WebMarkupMin 2.0.0 RC 2 solved this problem.

fioenix commented 8 years ago

Thank you very much for your support!

I used ASP.Net 4.5 (C#) & WebMarkupMin.Core.2.0.0-rc1, but after updated to RC2 I still saw this error.

I also removed duplicate meta tags.

This is original HTML code (not saved by the browser): Internet.Tivi.Sony.40.inch.KDL-40W700C.txt

Could you please help me to check if having any mistake?

Taritsyn commented 8 years ago

In this file not found problem.

You can check this, if you create the following action of controller:

[MinifyHtml]
public ActionResult Dmx()
{
    return new FileContentResult(
        System.IO.File.ReadAllBytes(@"C:\tmp\Internet.Tivi.Sony.40.inch.KDL-40W700C.txt"), "text/html");
}