Skip to content

Provide access to the contents of quoted strings #94

@nex3

Description

@nex3

Quoted.value returns the text of the string token as written in the stylesheet. This is useful in some circumstances, but in others the contents of the string is more important. This can be loosely approximated by stripping the string's quotes, but that returns an incorrect result if the string contains any kind of escape code.

Feature Use Case

I'm writing a PostCSS plugin that processes certain custom at-rules that are followed by quoted strings (for example, @foo "bar"). I need to access the values of those strings.

Feature Proposal

I propose a Quoted.contents getter that returns the semantic contents of the string. For example, for the CSS value "\"" it would return the string '"', and for the CSS value "\61"' it would return the string "a"`.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions