shithub: mycel

Download patch

ref: af660f135883e955653e0d6b5324d5bc83f8a48e
parent: de9bad8d5776023db5d6823dff07bd9b8afa2d02
author: Philip Silva <philip.silva@protonmail.com>
date: Wed Jan 13 16:55:31 EST 2021

ignore media print links

--- a/style/stylesheets.go
+++ b/style/stylesheets.go
@@ -74,6 +74,7 @@
 	f = func(n *html.Node) {
 		if n.Type == html.ElementNode && n.Data == "link" {
 			isStylesheet := false
+			isPrint := false
 			href := ""
 
 			for _, a := range n.Attr {
@@ -84,10 +85,12 @@
 					}
 				case "href":
 					href = a.Val
+				case "media":
+					isPrint = a.Val == "print"
 				}
 			}
 
-			if isStylesheet {
+			if isStylesheet && !isPrint {
 				hrefs = append(hrefs, href)
 			}
 		}