deanhume / html-minifier

A simple command line tool to minify your HTML, Razor views & Web Forms views
http://deanhume.github.io/html-minifier/
MIT License
134 stars 86 forks source link

Dictionary as Razor model #49

Open kbkrunner opened 5 years ago

kbkrunner commented 5 years ago

When the model definition is a Dictionary or other key-value list, the definition for is being split halfway through, it looks to happen on the comma ',' character. Then the rest of the minified contents are on the same line as the second half of the definition, causing a parser error.

Line 1: @model Dictionary<string, Line 2: MyAssemblyName.Setting[]> @{ ViewData["Title"] = "Settings"; ......

Edit: Found this happens when there is a space after the comma, when there's no space the program works fine. But VS adds a space after the comma when the page is formatted.