Skip to content

Parsing id / class selectors that starts with a hyphen/ number #34

@coxrichuk

Description

@coxrichuk

Please close if this is intended behaviour.

When I parse an ID or Class selector that starts with a hyphen or number this does not throw an error.

Example:

const { createParser } = require('css-selector-parser'); // v3.0.0

const parse = createParser({ strict: true, syntax: 'selectors-3' }); // Have also used css3 as syntax

const selectorWithANumber = parse('#123');
const selectorWithAHyphen = parse('.-foo');

Both return the ast rather than throwing an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions