requiredExtension = query.getValue(EXTENSION_PARAM);
query.removeValue(EXTENSION_PARAM);
queryString = query.toString();
}
LinkTarget target;
if (this.currentDoc != null) {
target = this.linkResolver.resolve(this.currentDoc, linkUri);
} else {
Link link = getAbsoluteLink(info, linkUri);
target = this.linkResolver.resolve(this.factory, link.getUri());
}
if (target.exists() && target.getDocument().hasLink()) {
Document targetDocument = target.getDocument();
String extension = getExtension(targetDocument, requiredExtension);
rewriteLink(newAttrs, config.attribute, targetDocument, anchor, queryString,
extension);
} else if (info.getArea().equals(Publication.AUTHORING_AREA)) {
markBrokenLink(newAttrs, config.attribute, linkUrl);