Skip to content

"API Documentation" page is outdated #231

Closed

Description

@Semigradsky

https://github.com/postcss/postcss-selector-parser/blob/master/API.md


  • Node

  • appendToPropertyAndEscape

  • setPropertyAndEscape

  • setPropertyWithoutEscape

  • valueToString

  • stringifyProperty

  • argument in clone?

  • Guard functions: isAttribute, isClassName, ..., etc

Activity

  1. MoOx commented on Nov 8, 2026

    @MoOx
    Collaborator

    Done in the 7.2.0 release, and thanks for the precise list: it is what made this straightforward to pick up five years later.

    API.md now documents, with examples:

    • node.stringifyProperty(name) and node.valueToString(), including the fact that valueToString() carries the marker the node type adds, a . for a class, a # for an id, the namespace prefix for an attribute or a tag.
    • node.setPropertyAndEscape(), node.appendToPropertyAndEscape() and node.setPropertyWithoutEscape(), under a new section explaining why a node keeps both a value and a raw value, and that these exist for non-standard syntax where the escaped form cannot be derived from the value.
    • The seventeen type guards in one table, with what each is true for, plus the two names that trip people up: the guard for an id selector is isIdentifier rather than isId, and isPseudoClass is defined as a pseudo that is not a pseudo-element, so it is true for an unknown :whatever.
    • The opts argument of node.clone(), and that its assignments go through the node's setters, so a property that escapes on assignment escapes there too.

    Every example and every row of the guard table was checked against the built parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions