Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error twig 3.9.2 #90

Closed
javiercno opened this issue Apr 23, 2024 · 3 comments · Fixed by #92
Closed

Error twig 3.9.2 #90

javiercno opened this issue Apr 23, 2024 · 3 comments · Fixed by #92

Comments

@javiercno
Copy link

javiercno commented Apr 23, 2024

Hello,

I updated my project to twig 3.9.2
Mjml return next error:

An exception has been thrown during the rendering of a template ("The command "'/var/www/node_modules/.bin/mjml' '-i' '-s' '--config.validationLevel' 'strict'"

The error is only use mjml twig tag, if use mjml service its correct.

The $mjmlContent content in BinaryRenderer.php is empy string.

The cache twig view is:

// line 1
        ob_start();
        yield "<mjml>
    <mj-body>
        <mj-section>
            <mj-column>

                <mj-image width=\"100px\" src=\"https://mjml.io/assets/img/logo-small.png\"></mj-image>

                <mj-divider border-color=\"#F45E43\"></mj-divider>

                <mj-text font-size=\"20px\" color=\"#F45E43\" font-family=\"helvetica\">Hello World</mj-text>

            </mj-column>
        </mj-section>
    </mj-body>
</mjml>
";
        $content = ob_get_clean();
        preg_match("/^\s*/", $content, $matches);
        $lines = explode("\n", $content);
        $content = preg_replace('/^' . $matches[0]. '/', "", $lines);
        $content = implode("\n", $content);
        echo $this->env->getExtension("NotFloran\MjmlBundle\Twig\Extension")->getMjml()->render($content);
@javiercno javiercno changed the title Error symfony 7.0 Error twig 3.9.2 Apr 23, 2024
@notFloran
Copy link
Member

notFloran commented Apr 24, 2024

I have made a PR (#92) to fix that.

I need to make some tests then I will release a new version.

@notFloran
Copy link
Member

I just made a release with the fix

@javiercno
Copy link
Author

Thank you very much for your speed, the work you do is fantastic 👏👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants