diff --git a/src/Compiler/ComponentTagCompiler.php b/src/Compiler/ComponentTagCompiler.php index be8408c..97e3c14 100644 --- a/src/Compiler/ComponentTagCompiler.php +++ b/src/Compiler/ComponentTagCompiler.php @@ -83,7 +83,13 @@ function (array $matches) { protected function componentStartString(string $component, string $attributes): string { - return "{% embed \"@" . $this->twigPathAlias . "/" . $this->normalizeComponentPathName($component) . ".twig\" with { props: $attributes } %}"; + return sprintf( + // another `%` is used for escaping the `%`, e. g. `%%` -> `%` + "{%% embed \"@%s/%s.twig\" with { props: %s } %%}", + $this->twigPathAlias, + $this->normalizeComponentPathName($component), + $attributes + ); } /**