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`, `.tt2` and `.tx` file extensions. It's not handled if this syntax is used in `.html` files 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.tx` like this: ```html <div class="[% IF $is_open %]bg-white/40[% ELSE %]bg-white/10[% END %]"></div> <!-- ^^^^^^^^^^^ ^^^^^^^^^^^ --> ``` 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 the `text-black` class not to be extracted. This is fixed as part of this PR because it was commented on the linked issue. Fixes: #20233 ## Test plan 1. Added a new extractor 2. Added regression tests 3. All existing tests pass |
||
|---|---|---|
| .. | ||
| classification-macros | ||
| ignore | ||
| node | ||
| oxide | ||