Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public abstract class HTMLParser extends BaseParser {

protected static final String SHORTCUT_ICON = "shortcut icon";
protected static final String ICON = "icon";
protected static final String PRELOAD = "preload";

protected static final String IE_UA = "MSIE ([0-9]+.[0-9]+)";// $NON-NLS-1$
protected static final Pattern IE_UA_PATTERN = Pattern.compile(IE_UA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ private static URL scanNodes(Node node, URLCollection urls, URL baseUrl) throws
if (TAG_LINK.equalsIgnoreCase(name) &&
(STYLESHEET.equalsIgnoreCase(getValue(attrs, ATT_REL))
|| SHORTCUT_ICON.equalsIgnoreCase(getValue(attrs, ATT_REL))
|| ICON.equalsIgnoreCase(getValue(attrs, ATT_REL)))) {
|| ICON.equalsIgnoreCase(getValue(attrs, ATT_REL))
|| PRELOAD.equalsIgnoreCase(getValue(attrs, ATT_REL)))) {
urls.addURL(getValue(attrs, ATT_HREF), baseUrl);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ public void head(Node node, int depth) {
} else if (tagName.equals(TAG_LINK)) {
String relAttr = tag.attr(ATT_REL);
// Putting the string first means it works even if the attribute is null
if (STYLESHEET.equalsIgnoreCase(relAttr) || ICON.equalsIgnoreCase(relAttr)
|| SHORTCUT_ICON.equalsIgnoreCase(relAttr)) {
if (STYLESHEET.equalsIgnoreCase(relAttr)
|| ICON.equalsIgnoreCase(relAttr)
|| SHORTCUT_ICON.equalsIgnoreCase(relAttr)
|| PRELOAD.equalsIgnoreCase(relAttr)) {
extractAttribute(tag, ATT_HREF);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ public void tag(Tag tag) {
if (relAttribute != null &&
(CharSequenceUtil.equalsIgnoreCase(STYLESHEET,relAttribute)
|| CharSequenceUtil.equalsIgnoreCase(ICON, relAttribute)
|| CharSequenceUtil.equalsIgnoreCase(SHORTCUT_ICON, relAttribute))) {
|| CharSequenceUtil.equalsIgnoreCase(SHORTCUT_ICON, relAttribute)
|| CharSequenceUtil.equalsIgnoreCase(PRELOAD, relAttribute))) {
extractAttribute(tag, ATT_HREF);
}
} else {
Expand Down