OWASP / java-html-sanitizer

Takes third-party HTML and produces HTML that is safe to embed in your web application. Fast and easy to configure.
Other
833 stars 210 forks source link

rel attributes are reordered in 20220608.1 #336

Open damianszczepanik opened 2 months ago

damianszczepanik commented 2 months ago

Upgrading to version 20240325.1 (previous 20220608.1 works fine) makes my testing failing because order of REL values changes. What is worse when I fix the order it passes with JDK17 but fails with JDK11

Test that starts failing https://github.com/damianszczepanik/cucumber-reporting/blob/8aed0cc6e6c41413b87047d0b89f73d750d37206/src/test/java/net/masterthought/cucumber/generators/EscapeHtmlReferenceTest.java#L66

Error message for JDK11

expected: "<a href="www.example.com" rel="nofollow noreferrer noopener">a hyper web reference</a>"
 but was: "<a href="www.example.com" rel="nofollow noopener noreferrer">a hyper web reference</a>"

PR with build/test output https://github.com/damianszczepanik/cucumber-reporting/pull/1179

Basically having this implementation is hardly possible to maintain code that is tested against different JVMs