We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c1e3a8 commit c185cb8Copy full SHA for c185cb8
internal/web/gist.go
@@ -443,8 +443,9 @@ func gistJs(ctx echo.Context) error {
443
js := `document.write('<link rel="stylesheet" href="%s">')
444
document.write('%s')
445
`
446
- js = fmt.Sprintf(js, cssUrl,
447
- strings.Replace(htmlbuf.String(), "\n", `\n`, -1))
+ content := strings.Replace(htmlbuf.String(), `\n`, `\\n`, -1)
+ content = strings.Replace(content, "\n", `\n`, -1)
448
+ js = fmt.Sprintf(js, cssUrl, content)
449
ctx.Response().Header().Set("Content-Type", "application/javascript")
450
return plainText(ctx, 200, js)
451
}
0 commit comments