Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenny Rakoczy <jennyrock42@gmail.com>2022-09-05 21:54:34 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-09-06 11:52:28 +0300
commit02c89a446d1a76491bfb4b9a756d892a83584d17 (patch)
treedba4f6aa968359aabe8bf50d016f06da931f03f4
parent06c3ac67411e2faaf1545427d4df4e326fffd3c0 (diff)
scss: Handle single-file sourcemaps correctly
Simple sites may only have one css file. Update the replace directive to correctly match single-file sourcemaps and multi-file sourcemaps. Verified locally with and without SASS and CSS imports. Fixes #8174
-rw-r--r--resources/resource_transformers/tocss/scss/tocss.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/resources/resource_transformers/tocss/scss/tocss.go b/resources/resource_transformers/tocss/scss/tocss.go
index 57ac16711..10bd1f6f8 100644
--- a/resources/resource_transformers/tocss/scss/tocss.go
+++ b/resources/resource_transformers/tocss/scss/tocss.go
@@ -163,7 +163,7 @@ func (t *toCSSTransformation) Transform(ctx *resources.ResourceTransformationCtx
// This is a workaround for what looks like a bug in Libsass. But
// getting this resolution correct in tools like Chrome Workspaces
// is important enough to go this extra mile.
- mapContent := strings.Replace(res.SourceMapContent, `stdin",`, fmt.Sprintf("%s\",", sourcePath), 1)
+ mapContent := strings.Replace(res.SourceMapContent, `stdin"`, fmt.Sprintf("%s\"", sourcePath), 1)
return ctx.PublishSourceMap(mapContent)
}