Review actions for #6242
Fix sillyness in the inRange function.
convert range to xrange in python code.
convert format flags to hex
pull out addition of link xml tag from `generateXMLAttribsForFormatting`
fix issue allowing links to be activated one character before they start