Handle template toolkit %]…[% syntax#20269
Conversation
Confidence Score: 5/5Safe to merge — changes are well-scoped pre-processor additions with no effect on existing file extensions. Both changes are additive and narrowly scoped: the Template Toolkit pre-processor only activates for .tt/.tt2/.tx files, and the Maud [ guard only fires inside html! blocks when the preceding character is not -. All boundary accesses are safe, and the new behavior is covered by unit tests plus regression tests. No files require special attention. Reviews (2): Last reviewed commit: "update changelog" | Re-trigger Greptile |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughTwo pre-processor fixes are added to the Tailwind CSS oxide extractor. A new 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
This PR handles template toolkit syntax as a pre-processor step such that
%]and[%are seen as valid boundary characters.This is handled for the
.tt,.tt2and.txfile extensions. It's not handled if this syntax is used in.htmlfiles because then everybody pays a pre processor cost even if you don't need this syntax in most cases.This now ensures that a
template.txlike this:Extracts the classes in between those conditions correctly.
This also fixes a small issue related to Maud, a template engine for Rust where conditionals like
p.text-black[condition]caused thetext-blackclass not to be extracted. This is fixed as part of this PR because it was commented on the linked issue.Fixes: #20233
Test plan