Skip to content

URL parsing differs from other native functions #34

Open
@tomrav

Description

@tomrav

We're using the value-parser in our Stylable project, and I'm encountering a use-case that feels inconsistent with the rest of the native functions.

By parsing whatever value resides inside a url as a single parameter (and not a complex AST), I am unable to iterate over the nested children (in my case, custom functions that will resolve to a url).

Example:
Source

.some-class {
    background: url(print(some-static-url));
}

Resolved target

"[
    {
        "type": "function",
        "sourceIndex": 0,
        "value": "url",
        "before": "",
        "nodes": [
            {
                "type": "word",
                "sourceIndex": 4,
                "value": "print(some-static-url"
            }
        ],
        "after": ""
    },
    {
        "type": "word",
        "sourceIndex": 26,
        "value": ")"
    }
]"

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