Compose HTML consistently in Banzai reference filters
These changes are proving to be necessary in advance of Clearly delineate text and HTML in Banzai, and ... (!207397) — the inconsistent treatment of text vs. HTML in the underlying method of reference detection/replacement is making every correction cause another spec to fail!
This MR replaces some of the ad-hoc HTML composition in Banzai with a consistent method. In particular, ReferenceFilter#data_attribute
no longer does any manual escaping, and we drop some confusing uses of escape_once
; we work with values which have a consistent level of trustedness at all times.
Todo:
-
Check in on full CI run (predictive is clear). -
Redo the AbstractReferenceFilter
spec in light of new consistency.
MVC — push to later iteration:
-
Remove Banzai uses ofescape_once
— it unacceptably blurs the line between levels of safety, and contributed a fair bit to confusion here.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.