Skip to content

Commit

Permalink
pretty-print newlines in data url paths
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Mar 14, 2022
1 parent edaf32a commit 73a539d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/bundler/bundler.go
Expand Up @@ -1211,6 +1211,10 @@ func (s *scanner) maybeParseFile(
if path.Namespace == "dataurl" {
if _, ok := resolver.ParseDataURL(path.Text); ok {
prettyPath = path.Text
if len(prettyPath) > 65 {
prettyPath = prettyPath[:65]
}
prettyPath = strings.ReplaceAll(prettyPath, "\n", "\\n")
if len(prettyPath) > 64 {
prettyPath = prettyPath[:64] + "..."
}
Expand Down

0 comments on commit 73a539d

Please sign in to comment.