zackad / prettier-plugin-twig

Code formatting plugin for Prettier to handle Twig templates
Apache License 2.0
57 stars 6 forks source link

Default arguments in macros aren't supported fully #80

Closed EvilKarter closed 2 weeks ago

EvilKarter commented 2 weeks ago

Hi, this relates to Issue 69.

I have updated to 0.11.0 and have following twig code

{% macro render(content, title, icon = '', type = '') %}

But I get still this error with the new version.

[error] templates/macros/badge.html.twig: Error: ERROR: Invalid Token
[error] > 1 | {% macro render(content, title, icon = '', type = '') %}
[error]     |                                         ^

The error is not shown if my default value ist not an empty string but a space for example

{% macro render(content, title, icon = ' ', type = ' ') %}