Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #2545972: Remove all code usages SafeMarkup::checkPlain() and rely more on Twig autoescaping
Problem/Motivation
The DiffFormatter is an HTML display of a diff - it needs to be able to display file diffs in a browser by escaping the markup the text contains. It also adds markup to denote which parts of each line are different - this should not be escaped.
Proposed resolution
Remove usage of SafeMarkup::checkPlain() in DiffFormatter and make it responsible for all escaping.
Remaining tasks
- Review
- Commit
User interface changes
None
API changes
The behaviour of HWLDFWordAccumulator is slightly changed to no longer escape markup - but it never should have been doing that.
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#5 | 2560055.5.patch | 7.23 KB | alexpott |
#5 | 2-5-interdiff.txt | 2.59 KB | alexpott |
#2 | 2560055.2.patch | 7.16 KB | alexpott |
Comments
Comment #2
alexpottThe patch adds assertion to the config diff test that exercise every line changed here.
Comment #3
star-szrLooks great, I like the added test coverage. RTBC if green :)
Comment #5
alexpottMade the assertions even better and fixed an incorrect one.
Comment #6
stefan.r CreditAttribution: stefan.r commentedBack to RTBC as this should be green now that we do
Comment #7
catchCommitted/pushed to 8.0.x, thanks!