My HTML, or what I thought was HTML, was actually generating an object of type Twig_Markup rather than a string, and therefore wasn't passing json validation. Hmm. raw didn't work. But Twig_Markup has a magic method, __toString() which is called, magically, when Twig_Markup is printed. So, I just had to invoke that directly. Which was as easy as: {% set buttonHtml = buttonHtml.__toString(buttonHtml) %) Happy coding! References: Twig_Markup API docs…
Read more about Casting Twig_Markup to string in TwigSometimes, you've got a Drupal twig function that doesn't exist in PatternLab, and it prevents PatternLab from building. You get an "Unknown filter" error. What you need to do is create a Twig stub that does either what you need it to, or nothing at all. In emulsify, twig functions exist at emulsify/components/_twig-components/filters. For example, to create a typogrify filter, create a file called typogrify.filter.php…
Read more about Add a New Twig Function in Patternlab