html-agility-pack icon indicating copy to clipboard operation
html-agility-pack copied to clipboard

Content not properly loaded while using Htmldocument.Load() method

Open GanesanRengasamy opened this issue 8 years ago • 9 comments

I am using the HtmlAgilityPack to do some changes in the existing html file. So, I have used the below code to load the html content.

string html = "Sample.cshtml"; HtmlDocument htmlContent = new HtmlDocument(); htmlContent.Load(html);

After load the html file some content has been changed which is differ from the original content. Please refer the below screenshot.

Before Load HTML file:

image

After Load HTML file:

image

Please suggest the solution to resolve this issue.

Thanks, Ganesan R.

GanesanRengasamy avatar May 16 '17 04:05 GanesanRengasamy

Hello @GanesanRengasamy ,

Unless I'm wrong, HAP has not been built to support Razor template.

Issue - applicationuser

Instead of skipping this template line, HAP currently parse it like an HTML tag, that's why the closing tag is added at the end.

Issue - returnurl

Currently, you use double quote inside a double quote. While it's valid in your template, that's not currently valid for HTML, which cause the following difference.


I have added this request to our todo list, however, at this moment, we prefer to concentrate our time on adding online documentation and fixing some basic bug instead of adding new features like this one.

So, unfortunately, that will not be fixed before a few months.

Best Regards,

Jonathan

JonathanMagnan avatar May 17 '17 00:05 JonathanMagnan

Hi @JonathanMagnan

Thanks for your response. I am waiting for this feature.

GanesanRengasamy avatar May 26 '17 11:05 GanesanRengasamy

Hi @JonathanMagnan ,

I have faced similar issue like this. Is there any workaround for this bug ?

Abbas1546 avatar May 26 '17 12:05 Abbas1546

@JonathanMagnan - Any update regarding this ?

Abbas1546 avatar Jun 16 '17 05:06 Abbas1546

Hello @Abbas1546 ,

Unfortunately, as we said, we will not look on this issue before a few months.

HAP has been created to parse HTML not Razor/MVC file. We currently get more request than we can handle for this library.

During the summer (next months), we may start to look about either creating a v2 version of the parser for handling more scenario like this one, but we cannot guarantee anything currently.

Best Regards,

Jonathan

JonathanMagnan avatar Jun 16 '17 14:06 JonathanMagnan

@JonathanMagnan Any update on this?

GanesanRengasamy avatar Sep 14 '17 09:09 GanesanRengasamy

Hello @GanesanRengasamy ,

Unfortunately no yet,

We currently looking to fully rewrite Html Agility Pack to make it more flexible and support some code like Razor but we cannot provide or commit our self to any date at this time.

Best Regards,

Jonathan

JonathanMagnan avatar Sep 14 '17 12:09 JonathanMagnan

Hi @JonathanMagnan

Could you please update me is there this feature has been included or not in HAP?

Syncfusion-JavaScript avatar Apr 24 '18 10:04 Syncfusion-JavaScript

Hello @Syncfusion-JavaScript ,

No, supporting other languages such as Razor is not yet supported.

Best Regards,

Jonathan

JonathanMagnan avatar Apr 24 '18 10:04 JonathanMagnan