Skip to content

if rules has :marker then selectorText is null #186

Closed
@mirrortom

Description

@mirrortom

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version of AngleSharp.Css?
  • Did you check the FAQs to see if that helps you?
  • Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., AngleSharp.Xml for Xml support)
  • Did you perform a search in the issues?

Description

use AngleSharp.Css 0.17.0 and runtime is C# console

// source css
.list.disc > li::marker{color:red}

// parse this css rule
var styles = parser.Parse(css);
var rule = styles[0] as CssStyleRule;

// the SelectorText value is null
rule.SelectorText

I will get the selector,but the prop SelectorText is null! If the style rules has ":marker".
I can not fix this.help me please!

Steps to Reproduce

string css = @"
.list.disc > li::marker {
color: var(--t-list-style-color);
font-size: 1.2em;
}";

var parser = new AngleSharp.Css.Parser.CssParser();
var stylesheet = parser.ParseStyleSheet(css);

var rule = stylesheet.Rules[0] as AngleSharp.Css.Dom.ICssStyleRule;

Console.WriteLine(rule.SelectorText);

Expected Behavior

// get selectorText
.list.disc > li::marker

Actual Behavior

// the selectorText is null

Possible Solution / Known Workarounds

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions