- xs << xml::StartTag("link", "xlink:href=\"" + subst(getParam("target"), from_ascii("&"), from_ascii("&")) + "\"");
+ docstring target = subst(getParam("target"), from_ascii("&"), from_ascii("&")) ;
+ xs << xml::StartTag("link", "xlink:href=\"" + makeURL(target, getParam("type")) + "\"");