You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Returns a fragment processor in the proper context
74
74
75
75
**How to enable table support:**
76
-
1.`WP_HTML_Template` already uses an anonymous class extending `WP_HTML_Processor` to access private members
77
-
2. The same pattern can expose `create_fragment_at_current_node()`
78
-
3. Create full parser: `<!DOCTYPE html><table><tbody>`, navigate to `<tbody>`, call exposed method
79
-
4. Fragment processor will be in IN_TABLE_BODY mode where `<tr>` and placeholders are valid
76
+
1. Use `Closure::bind` to access `create_fragment_at_current_node()` without modifying `WP_HTML_Processor`
77
+
2. Create full parser: `<!DOCTYPE html><table><tbody>`, navigate to `<tbody>`, call the private method via bound closure
78
+
3. Fragment processor will be in IN_TABLE_BODY mode where `<tr>` and placeholders are valid
80
79
81
80
**Limitations that would remain:**
82
81
- Cannot put arbitrary content (like `<div>`) inside table cells via placeholders (would trigger foster parenting)
@@ -96,6 +95,8 @@ Normalization runs twice: once in `compile()` for text detection, once in `rende
96
95
**6. ~~Duplicate Attributes Bug with false/null Removal~~ FIXED**
97
96
~~When using `false` or `null` to remove an attribute, only the first occurrence is removed. If the HTML contains duplicate attributes (e.g., `<input disabled="</%d>" disabled>`), the first `disabled` will be removed but the second will remain in the output.~~ Fixed by emitting removal edits for duplicate attributes during `compile()`. All duplicate attributes are now stripped as part of template compilation.
98
97
98
+
**Implementation note:** The fix currently accesses `$attributes` and `$duplicate_attributes` on `WP_HTML_Tag_Processor` via `protected` visibility. This should be refactored to use `Closure::bind` instead, allowing the Tag Processor changes to be reverted.
99
+
99
100
---
100
101
101
102
### Gaps in Test Coverage (From Test-Gaps.md + My Observations)
@@ -157,3 +158,9 @@ The ticket's philosophy is "prefer trust and safety over features"—valid, but
1.**Revert Tag Processor visibility changes** — `class-wp-html-tag-processor.php` has `$attributes` and `$duplicate_attributes` changed from `private` to `protected`. Revert these and use `Closure::bind` in `WP_HTML_Template` instead.
0 commit comments