protected String removeLinkAttributes(String html) {
		//remove type from link tags with rel=stylesheet
		if(removeLinkAttributes) {
			Matcher matcher = linkTypeAttrPattern.matcher(html);
			StringBuffer sb = new StringBuffer();
			while(matcher.find()) {
				//if rel=stylesheet
				if(linkRelAttrPattern.matcher(matcher.group(0)).matches()) {
					matcher.appendReplacement(sb, "$1$3");
				} else {
					matcher.appendReplacement(sb, "$0");
				}
			}
			matcher.appendTail(sb);
			html = sb.toString();
		}
		return html;
	}