Defect #44705
closedSanitizationFilterTest#test_should_sanitize_html_strings fails with Nokogiri 1.19.5 and later
Description
Starting with Nokogiri 1.19.5, the following test fails:
Failure: Redmine::WikiFormatting::CommonMark::SanitizationFilterTest#test_should_sanitize_html_strings [test/unit/lib/redmine/wiki_formatting/common_mark/sanitization_filter_test.rb:156]: --- expected +++ actual @@ -1 +1 @@ -"Lorem <a href=\"pants\" title=\"foo>ipsum <a href=\"><strong>dolor</strong></a> sit<br>amet " +"Lorem <a href=\"pants\" title=\"foo>ipsum <a href=\"><strong>dolor</strong></a> sit<br>amet "
The failure occurs because updating Nokogiri to 1.19.5 or later changes the sanitized output. Since Nokogiri 1.19.5, < and > in attribute values are escaped as < and >, following whatwg/html#6362 (see sparklemotion/nokogiri#3741). This is an intended change in Nokogiri and does not affect how the HTML is displayed.
The attached patch updates the expected value in the test to match the new output. It changes test code only. Because the updated expected value does not match the output of Nokogiri 1.19.4 and earlier, the patch requires Nokogiri 1.19.5 or later and should be applied together with #44704, which updates the Nokogiri requirement.
Files
Updated by Go MAEDA about 1 month ago
- Blocks Patch #44704: Update Nokogiri to 1.19.7 or later added
Updated by Go MAEDA about 1 month ago
- Status changed from New to Resolved
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch in r25417.
Updated by Go MAEDA about 1 month ago
- Blocks deleted (Patch #44704: Update Nokogiri to 1.19.7 or later)
Updated by Go MAEDA about 1 month ago
- Blocked by Patch #44704: Update Nokogiri to 1.19.7 or later added
Updated by Go MAEDA about 1 month ago
- Status changed from Resolved to Closed
- Target version changed from 6.1.7 to 7.0.4
Merged the fix into 7.0-stable in r25422.