// We must not clone the processors, because we remove attributes
Element substituteElement =
element.cloneElementNodeWithNewName(element, substituteName, false);
+ // Remove attributes, that are not allowed for <span> or <strong>
substituteElement.removeAttribute("charset");
substituteElement.removeAttribute("th:charset");
substituteElement.removeAttribute("coords");
substituteElement.removeAttribute("th:target");
substituteElement.removeAttribute("type");
substituteElement.removeAttribute("th:type");
+ // Also remove the title-attribute, because the mouse-over is confusing
+ substituteElement.removeAttribute("title");
+ substituteElement.removeAttribute("th:title");
+ // Replace the element
element.clearChildren();
element.addChild(substituteElement);
element.getParent().extractChild(element);