Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[svelte-parse] Modifiers on attributes without values #181

Closed
halfnelson opened this issue Nov 15, 2020 · 0 comments · Fixed by #194 or #190
Closed

[svelte-parse] Modifiers on attributes without values #181

halfnelson opened this issue Nov 15, 2020 · 0 comments · Fixed by #194 or #190
Labels
bug Something isn't working

Comments

@halfnelson
Copy link
Contributor

when the parser encounters an attribute with a modifier but no value, it continues to add tokens to the modifier name until >or =

<a on:click|preventDefault booleanAttribute></a>

gives

      {
          "type": "svelteDirective",
          "name": "on",
          "value": [],
          "modifiers": [
            {
              "value": "preventDefaultbooleanAttribute",
              "type": "modifier",
              "position": {
                "start": {
                  "line": 1,
                  "column": 12,
                  "offset": 11
                },
                "end": {}
              }
            }
          ],
          "shorthand": "none",
          "position": {
            "start": {
              "line": 1,
              "column": 4,
              "offset": 3
            },
            "end": {}
          },
          "specifier": "click"
        }
@pngwn pngwn added bug Something isn't working svelte-parse labels Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants