CsQuery
CsQuery copied to clipboard
CQ.CreateFromFile issue with html attributes with epmty values which are converting into unsupported formtat.
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 .
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.