diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e97ec59..590e146b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/plugins/vento.ts b/plugins/vento.ts index ecc45358..28662099 100644 --- a/plugins/vento.ts +++ b/plugins/vento.ts @@ -177,7 +177,7 @@ function compTag( } const match = code.match( - /^comp\s+([\w.]+)(?:\s+(\{.*\}))?(?:\s+(\/))?$/, + /^comp\s+([\w.]+)(?:\s+([\s\S]+[^/]))?(?:\s+(\/))?$/, ); if (!match) { diff --git a/tests/__snapshots__/vento.test.ts.snap b/tests/__snapshots__/vento.test.ts.snap index 8f191716..a4d86eb6 100644 --- a/tests/__snapshots__/vento.test.ts.snap +++ b/tests/__snapshots__/vento.test.ts.snap @@ -183,7 +183,9 @@ CUSTOM FILTER ], content: '

{{ title }}

-{{ comp button {href: "https://lume.land"} }} +{{ comp button { + href: "https://lume.land" +} }} Go to Lume {{ /comp }} diff --git a/tests/assets/vento/index.vto b/tests/assets/vento/index.vto index 1fb2110d..b34535fa 100644 --- a/tests/assets/vento/index.vto +++ b/tests/assets/vento/index.vto @@ -5,7 +5,9 @@ layout: layout.vto

{{ title }}

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