Skip to content

Commit 8acf1b3

Browse files
committed
Fix CSS attributes
1 parent 90e1a9a commit 8acf1b3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Diff for: manipulations/injectassets/injectassets.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ func addSyncCSS(headNode, bodyNode *html.Node, asset assetmanager.Asset) error {
138138
}
139139

140140
node.AppendChild(htmlparsing.SyncCSSTag(htmlparsing.CSSTagData{
141-
URL: u,
142-
Media: asset.Media(),
141+
URL: u,
142+
Attributes: asset.Attributes(),
143+
Media: asset.Media(),
143144
}))
144145

145146
return nil
@@ -154,8 +155,9 @@ func addAsyncCSS(headNode, bodyNode *html.Node, asset assetmanager.Asset) error
154155
bodyNode.AppendChild(
155156
htmlparsing.AsyncCSSTag(
156157
htmlparsing.CSSTagData{
157-
URL: u,
158-
Media: asset.Media(),
158+
URL: u,
159+
Attributes: asset.Attributes(),
160+
Media: asset.Media(),
159161
},
160162
),
161163
)

Diff for: manipulations/injectassets/injectassets_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ func TestSyncCSS(t *testing.T) {
356356
},
357357
},
358358
},
359-
want: `<html><head><link href="http://example.com/url.css" rel="stylesheet"/></head><body></body></html>`,
359+
want: `<html><head><link example="test" example-2="test-2" href="http://example.com/url.css" rel="stylesheet"/></head><body></body></html>`,
360360
},
361361
}
362362

0 commit comments

Comments
 (0)