private void applyLinkAttributes(Attributes attributes, String href) {
applyAttributes(attributes);
boolean hasTarget = false;
String rel = linkRel;
if (attributes instanceof LinkAttributes) {
LinkAttributes linkAttributes = (LinkAttributes) attributes;
if (linkAttributes.getTarget() != null) {
hasTarget = true;
writer.writeAttribute("target", linkAttributes.getTarget());
}
if (linkAttributes.getRel() != null) {
rel = rel==null?linkAttributes.getRel():linkAttributes.getRel()+' '+rel;
}
}
if (attributes.getTitle() != null && attributes.getTitle().length() > 0) {
writer.writeAttribute("title", attributes.getTitle());
}