Skip to content

Commit

Permalink
allow multiline code for {{ comp }}
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Jul 3, 2024
1 parent 66dc59a commit 25aba5f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
### Fixed
- Nav plugin: the `order` option is not applied.
- Updated dependencies: `std`, `postcss`.
- Vento plugin for component doesn't support multiline code.

## [2.2.2] - 2024-06-21
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion plugins/vento.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function compTag(
}

const match = code.match(
/^comp\s+([\w.]+)(?:\s+(\{.*\}))?(?:\s+(\/))?$/,
/^comp\s+([\w.]+)(?:\s+([\s\S]+[^/]))?(?:\s+(\/))?$/,
);

if (!match) {
Expand Down
4 changes: 3 additions & 1 deletion tests/__snapshots__/vento.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ CUSTOM FILTER
],
content: '<h1>{{ title }}</h1>
{{ comp button {href: "https://lume.land"} }}
{{ comp button {
href: "https://lume.land"
} }}
Go to Lume
{{ /comp }}
Expand Down
4 changes: 3 additions & 1 deletion tests/assets/vento/index.vto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ layout: layout.vto

<h1>{{ title }}</h1>

{{ comp button {href: "https://lume.land"} }}
{{ comp button {
href: "https://lume.land"
} }}
Go to Lume
{{ /comp }}

Expand Down

0 comments on commit 25aba5f

Please sign in to comment.