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 removes </br> #126

Closed kaushambi2612 closed 3 years ago

kaushambi2612 commented 3 years ago

<'br> or <'br/> doesn't get removed. ✔ <'/br> gets removed from the html. ❌

I understand that <'/br> is not the suggested way of adding a line-break. But, I'd like to know which setting would help me prevent the removal of this.

Till now, I have used: options.MinificationSettings.PreservableOptionalTagList = "br"; options.MinificationSettings.RemoveOptionalEndTags = false;

[added a ' to prevent github from using the tags]

Taritsyn commented 3 years ago

Hello, Kaushambi!

…, I'd like to know which setting would help me prevent the removal of this.

This setting does not exist, but you can use the ignoring comment tags.

</br> is not an optional HTML end tag. This syntax is not acceptable from the point of view of HTML standard. You can check this with a validator:

Error: End tag br.
From line 11, column 99; to line 11, column 103
r</a> <br></br>sit am
kaushambi2612 commented 3 years ago

Ok, thanks for the prompt reply! I am receiving the HTML from a different source. I think it's better to get the wrong tag corrected.