boolean errorWithSrcLocation = t.getSrcSpan().getEnd() < 0;
String templateTextOrig;
if (!errorWithSrcLocation){
templateTextOrig = xml.getBody().substring(t.getSrcSpan().getStart(), t.getSrcSpan().getEnd());
}else{
int estimatedLength = t.getPos().getEnd() - t.getPos().getStart();
templateTextOrig = xml.getBody().substring(t.getSrcSpan().getStart(), t.getSrcSpan().getStart() + estimatedLength + 1);
NameSpace type = destTitle.getNamespace();
if (type == NameSpace.ARTICLE){
ParsedLocation location = new ParsedLocation(xml, secNum, paraNum, t.getSrcSpan().getStart());
visitLink(location, destTitle, templateLink.getText(), tempSubType);
} else if (type == NameSpace.CATEGORY){
ParsedCategory pc = new ParsedCategory();
pc.location = new ParsedLocation(xml, secNum, paraNum, t.getSrcSpan().getStart());
pc.category = destTitle;
visitCategory(pc);
Title destTitle = new Title(dest, lang);
try {
ParsedLocation location = new ParsedLocation(xml, secNum, paraNum, t.getSrcSpan().getStart());
visitLink(location, destTitle, dest, tempSubType);
} catch (WikiBrainException e) {