AngleSharp / AngleSharp.Css

:angel: Library to enable support for cascading stylesheets in AngleSharp.

Home Page:https://anglesharp.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support `@counter-style` and `@font-feature-values`

mganss opened this issue · comments

The at-rules @counter-style and @font-feature-values are not currently supported by the parser.

var html = @"<style>
                @font-feature-values Font One {
                    @styleset {
                    nice-style: 12;
                    }
                }
                @counter-style thumbs {
                  system: cyclic;
                  symbols: ""\1F44D"";
                  suffix: "" "";
                }
            </style>";
var parser = new HtmlParser(new HtmlParserOptions(), BrowsingContext.New(Configuration.Default.WithCss(new CssParserOptions())));
var dom = parser.ParseDocument(html);
var styleSheet = dom.StyleSheets[0] as ICssStyleSheet;
var css = styleSheet.ToCss(); // -> ""
var rules = styleSheet.Rules.Length; // -> 0

Landed in devel.

@FlorianRappl In the example above, ToCss() produces @font-feature-values { } @counter-style { } using v0.17.0 and above. Is this expected behavior?