Closed walterDurin closed 8 years ago
i have found that the inline commented code with // in razor block code the code after first comment will be commented.
the code
@{
int GridHeight = CTRL_K_GRID_HEIGHT_LG;
int GridWidth_Workflow = 100;//CTRL_K_GRID_COLUMN_LEN_LG;
int GridWidth_Request = 150;//CTRL_K_GRID_COLUMN_LEN_XL;
int GridWidth_Customer = 100;//CTRL_K_GRID_COLUMN_LEN_LG;
}
the minified code
@{ int GridHeight = CTRL_K_GRID_HEIGHT_LG;int GridWidth_Workflow = 100;//comment start here CTRL_K_GRID_COLUMN_LEN_LG;int GridWidth_Request = 150;//CTRL_K_GRID_COLUMN_LEN_XL;int GridWidth_Customer = 100;//CTRL_K_GRID_COLUMN_LEN_LG; }
edited : maybe it's my bad. i should to delete these comment thing before do the minification.
Your problem is that the inline comment detector requires one space following the // i believe this is intentional to stop stripping out http addresses ie http://www.google.com would be http: which would break i believe the fix from the pull request will fix it specifically "htmlContents = Regex.Replace(htmlContents, @"[^:|""|']//(.*?)\r?\n", "");"
This has been fixed with the latest release https://github.com/deanhume/html-minifier/releases
If a Razor page uses @: it might break as the html-minifier makes no special exceptions for it they should be on their own lines or at least end the line. @: requires line break to end tag.
@"@:(.*?)\r?\n" regex should find them, before minimization.