v2.1.1
What's Changed
Fixed
-
|typographyno longer fatals on a number or a boolean — the upstream filter's signature isStringable|string|null, and only arrays were guarded, so an int reached it and raised aTypeError: a 500 on the whole page rather than a filter that declined. Ints, floats and booleans now pass through untouched, alongside the render arrays that already did. Passing through rather than casting is deliberate — typography is for prose, a number gains nothing from a non-breaking space, and the value keeps its type for arithmetic or a chained filter further down the template.The list stops there on purpose, and an object still reaches upstream. This filter is registered
is_safe => ['html'], so what it returns is printed unescaped; passing an arbitrary object through would extend that promise to a value the extension never inspected, and Drupal prints an object carrying atoString()method raw. An object reaching a typography filter is a template defect and stays loud.Found while migrating a site off its local
custom_componentscopy, whose filter cast silently: a branch count piped through|typographyrendered there and took two pages down here. Every consumer moving to this package is one such call away from the same page, so the tolerance belongs in the filter rather than in a rule each site has to remember.
Pull Requests
- #117 — fix(typography): pass non-string values through instead of fataling
Full Changelog: v2.1.0...v2.1.1