MagicSaxFilter.java will add an extra rel="..." attribute if the existing one is the first attribute
This block of code in MagicSaxFilter:
if ((relIndex = validattributes.getIndex("rel")) > 0) {
validattributes.setValue(relIndex, relValue);
} else {
validattributes.addAttribute(makeSimpleQname("rel"), "CDATA", relValue);
}
will incorrectly add a second rel attribute if the first attribute is rel. Fix: Change that condition to >= 0
Example <a rel="nofollow" othervalidattributes> will end up being rewritten as <a rel="nofollow" othervalidattributes rel="nofollow>
@spassarop - Can you look into this?
@LanceNeumannBlackboard you are right. Current tests do not have the rel attribute first so it never came up. I created PR #588 with the fix and specific tests that basically count the number of rel occurrences.
@LanceNeumannBlackboard - I've merged @spassarop's change into the main branch. Can you build/test this locally to confirm this fixes your issue?
Sorry - missed your update last month. I tried your change with 1.7.9-SNAPSHOT built locally and it works as expected.