New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MarkupMinificationException when having nested SVG element inside an SVG #8

Closed
kimpenhaus opened this Issue Jun 9, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@kimpenhaus
Copy link

kimpenhaus commented Jun 9, 2016

When we try to minify HTML Code with having nested SVG elements inside another SVG the minification process stops with an exception:

An exception of type WebMarkupMin.Core.Minifiers.MarkupMinificationException occurred and was caught.
-------------------------------------------------------------------------------------------------------
06/09/2016 14:08:21
Type : WebMarkupMin.Core.Minifiers.MarkupMinificationException, WebMarkupMin.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=99472178d266584b
Message : Category: HTML_MINIFICATION_ERROR
Message: During minification of SVG-code error has occurred: "Tag <svg> was not closed.".
Source fragment:

Line 614:         <defs>
Line 615:             <svg id="sparziel-point" class="smartmeter-vertrag-wrapper__svg--sparziel__point-wrapper" …
----------------------^
Line 616:                 <circle r="8px" cx="0" cy="-2" style="fill: white; stroke-width: 4px; stroke: #f90;" clas…


Source : WebMarkupMin.Core
Help link : 
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Error(System.String, System.String, System.String, Int32, Int32, System.String)
HResult : -2146233088
Stack Trace :    bei WebMarkupMin.Core.Loggers.ThrowExceptionLogger.Error(String category, String message, String filePath, Int32 lineNumber, Int32 columnNumber, String sourceFragment)
   bei WebMarkupMin.Core.Minifiers.GenericHtmlMinifier.ProcessEmbeddedSvgContent(MarkupParsingContext context, String svgContent)
   bei WebMarkupMin.Core.Minifiers.GenericHtmlMinifier.TextHandler(MarkupParsingContext context, String text)
   bei WebMarkupMin.Core.Parsers.HtmlParser.ProcessEmbeddedCode()
   bei WebMarkupMin.Core.Parsers.HtmlParser.Parse(String content)
   bei WebMarkupMin.Core.Minifiers.GenericHtmlMinifier.Minify(String content, String fileContext, Encoding encoding, Boolean generateStatistics)
   bei WebMarkupMin.Web.Filters.MarkupMinificationFilterStreamBase`1.Close()
   bei System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr)
   bei System.Web.HttpResponse.FilterOutput()
   bei System.Web.HttpApplication.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   bei System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

The HTML snippet which is causing the exception is:

<svg width="100%" viewBox="0 0 290 150" preserveAspectRatio="xMidYMin" class="some-class">
                    <desc>some description</desc>
                    <defs>
                        <mask id="inner-arc">
                            <circle class="chart__svg__circle" cx="145" cy="150" r="96" />
                        </mask>
                        <mask id="outer-arc">
                            <circle class="chart__svg__circle" cx="145" cy="150" r="130" />
                        </mask>
                    </defs>
                    <rect transform="rotate( @Model.PrognostizierterVerbrauchWinkel 145 150 )" enbw:data="rotate( @Model.PrognostizierterVerbrauchWinkel 145 150 )" x="0" y="0" mask="url(#inner-arc)" class="chart__svg__fill--basic rotatable_js" width="290" height="150" />
                    <rect transform="rotate( @Model.AktuellerVerbrauchWinkel 145 150 )" enbw:data="rotate( @Model.AktuellerVerbrauchWinkel 145 150 )" mask="url(#outer-arc)" class="chart__svg__fill--ht rotatable_js" width="290" height="150" x="0" y="0" />
 </svg>

If you need any further information, please let me know.
Thanks for taking your time, I really appreciate!

@Taritsyn

This comment has been minimized.

Copy link
Owner

Taritsyn commented Jun 9, 2016

Thanks for information!

Next week I will fix this error. Unfortunately, at the moment there is no free time.

@kimpenhaus

This comment has been minimized.

Copy link

kimpenhaus commented Jun 9, 2016

Thanks!

Taritsyn added a commit that referenced this issue Jun 13, 2016

@Taritsyn

This comment has been minimized.

Copy link
Owner

Taritsyn commented Jun 13, 2016

Hello, Marcus!

In WebMarkupMin 2.0.0 RC 9 fixed this error.

@Taritsyn

This comment has been minimized.

Copy link
Owner

Taritsyn commented Jun 14, 2016

Also, this error is fixed in the WebMarkupMin 1.1.2.

@Taritsyn Taritsyn closed this Jun 14, 2016

@kimpenhaus

This comment has been minimized.

Copy link

kimpenhaus commented Jun 14, 2016

That was quick - thank you! It works perfect :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment