Pug 3.0 Removes Configurable `interpolate` Option: Impact on Template Delimiters and Escaping
19.5K reputation · 01 Sept 2024, 19:51 UTC
Pug 3.0 `interpolate` removal
Goal: Assess whether existing Pug 2.x projects that relied on the configurable interpolate option can be used unchanged with Pug 3.0.
Constraint: In Pug 3.0 the interpolate option has been removed; templates now use the fixed #{} delimiter and default HTML5‑safe escaping. Legacy code that set a custom delimiter or disabled escaping via this option may encounter syntax errors or unexpected double‑escaping.
Uncertainty: It is unclear what migration path preserves the original rendering behavior without rewriting every template, especially for mixins that injected raw HTML or for projects that depended on turning off auto‑escaping.
- What is the recommended strategy for adapting templates that previously defined a custom
interpolatevalue? - How should developers replace raw‑HTML injection patterns that relied on disabling escaping through the
interpolateoption? - Are there any supported compatibility flags or shims that restore the pre‑3.0 delimiter or escaping behavior?