Skip to content

Commit 5a1c2a3

Browse files
Feat: path must honor original expected path format in HTML links
1 parent 536c564 commit 5a1c2a3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/html/processor.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,14 @@ func Transform(options *compactor.Options, file *compactor.File) error {
192192
}
193193

194194
path := related.Path
195-
destination := "./" + options.CleanPath(related.File.Destination)
195+
destination := options.CleanPath(related.File.Destination)
196+
197+
if strings.HasPrefix(path, "/") {
198+
destination = "/" + destination
199+
} else if strings.HasPrefix(path, "./") {
200+
destination = "./" + destination
201+
}
202+
196203
content = strings.Replace(content, path, destination, 1)
197204

198205
}

0 commit comments

Comments
 (0)