@Override
	public void endElement(String uri, String localName, String qName) throws SAXException {
		Element element = HtmlFactory.getElement(localName);
		if (element == Element.A || element == Element.AREA || element == Element.LINK) {
			anchorFlag = false;
			if (curUrl != null) {
				String anchor = anchorText.toString().replaceAll("\n", " ").replaceAll("\t", " ").trim();
				if (!anchor.isEmpty()) {
					if (anchor.length() > MAX_ANCHOR_LENGTH) {
						anchor = anchor.substring(0, MAX_ANCHOR_LENGTH) + "...";
					}
					curUrl.setAnchor(anchor);
				}
				anchorText.delete(0, anchorText.length());
			}
			curUrl = null;
		}
		if (element == Element.BODY) {
			isWithinBodyElement = false;
		}
	}