wingsuit-designsystem / wingsuit

Twig for Storybook
GNU General Public License v2.0
90 stars 16 forks source link

Storybook 7 does not recognize certain Twig filters #286

Open kaouthar-rahmi opened 5 days ago

kaouthar-rahmi commented 5 days ago

I'm encountering an issue where Storybook 7 fails to recognize specific Twig filters, such as htmlspecialchars_decode, when rendering templates in Wingsuit 2.0.0-beta.1. Steps to Reproduce:

Set up a project using Wingsuit 2.0.0-beta.1 and Storybook 7. Use a Twig template that includes the htmlspecialchars_decode filter, e.g. {{ text | htmlspecialchars_decode }}. Attempt to view the component in Storybook. Expected Behavior: Storybook should correctly render the component and apply the htmlspecialchars_decode filter to the text variable.

Actual Behavior: Storybook displays an error or renders the template without applying the htmlspecialchars_decode filter. See screenshot here : Capture d’écran 2024-07-02 à 16 35 45 I have also attempted to add custom Twig filters in the _macros folder following the documentation, specifically duplicating the environment.js file, but have been unable to make them work within Storybook. any ideas ?