Accessing the Document.Root.OuterHtml Property gives incorrectly formatted HTML

Hi,

I've come across an issue (I think). I load some html in a HTMLUIControl using the LoadFromString method. Passing in correctly formatted Html with an internal style sheet. I then use the API of the HTMLUIControl to make some changes to some elements (mainly replacing image paths in image tags). I then want to get the 'edited' html from the control. I am doing this back accessing {the HtmlUiControl}.Document.Root.OuterHtml property. 

However the string returned isn't quite correct. Everything seems fine.. apart from the internal css. The style tag, that once contained valid CSS now contains my valid CSS wrapped in a CDATA tag.

eg.

<style><!CDATA[

Body {

     color: #ffffff

}

]]> 


This is causing issues for where I want to use this html later.

Is there anyway I can stop this happening?

Thanks

Using Syncfusion.HTMLUI.Windows, Version=6.402.0.15

1 Reply

KR Kannan R Syncfusion Team September 18, 2018 12:02 PM UTC

Hi David, 
 
Thank you for contacting Syncfusion Support.  
 
No, in HTMLUIControl we are maintaining patterns for recognizing HTML and CSS tags and rendering the view based on that. So, like the reported it has some modifications and will not be exactly same as in loaded format. If this reported requirement is only to retrieve loaded format, we suggest you to maintain locally in Application level like in the form of storing in Property. Otherwise, kindly let us know in detail. So that we can check and provide solution based on that.  
 
Regards, 
Kannan 


Loader.
Up arrow icon