CsQuery icon indicating copy to clipboard operation
CsQuery copied to clipboard

CQ.CreateFromFile issue with html attributes with epmty values which are converting into unsupported formtat.

Open RajuA opened this issue 11 years ago • 1 comments

Hi, empty html attbutes are converting in to unsupported format Example:

<div itemscope="" itemtype="http://schema.org/Product" class="">

is parsed by csQuery as

<div itemscope itemtype="http://schema.org/Product" class>

which is causing problem in generating page markup in asp-net . Please help to fix this issue .

RajuA avatar Sep 05 '14 06:09 RajuA

Well, for HTML it's totally valid format.

It's standard behavior of RenderAttribute() method inside FormatDefault class. There is no setting to disable this, and you can't override this method, because it's protected, but not virtual(which is little strange). You can override RenderElementInternal() method to format attributes output differently. Or you can implement your own IOutputFormatter from scratch.

rufanov avatar May 23 '15 08:05 rufanov