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
440 stars 48 forks source link

MarkupParsingException without log #132

Closed matteomigliore closed 2 years ago

matteomigliore commented 2 years ago

When the framework fails to minify the HTML in the output Windows there is only the MarkupParsingException without details that allow to fix the issue.

Taritsyn commented 2 years ago

Hello, Matteo!

Since an instance of the MarkupParsingException class cannot be created without specifying an error message, then some kind of error message should be displayed. MarkupParsingException is internal exception and should not be visible to end users. You are most likely getting a MarkupMinificationException.

What error message is displayed in your case?

matteomigliore commented 2 years ago

Hello Taritsyn!

After you answer I enabled all the exceptions in Debug menu and I saw the specific error. In my case where some tags with required attribute without value so <input ... required />.

You should use Microsoft.Extensions.Logging framework to show the messages in the log.

Taritsyn commented 2 years ago

Hello, Migliore!

After you answer I enabled all the exceptions in Debug menu and I saw the specific error. In my case where some tags with required attribute without value so <input ... required />.

Can you give an example of the full error message?

You should use Microsoft.Extensions.Logging framework to show the messages in the log.

WebMarkupMin is used not only in ASP.NET Core, so I leave the specific implementation of logger to end user.

Taritsyn commented 2 years ago

I got the feeling that you are trying to minify HTML output by using XML minifier.