Skip to content

Commit 62ab2e7

Browse files
committed
fix: escape double quotes if they appear in constant str
1 parent 440baa6 commit 62ab2e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/printer/printer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func (w *writer) printConstant(c *ast.Constant, indent int32) {
282282
str = `"""`
283283
}
284284
w.print(str)
285-
w.print(n.Str)
285+
w.print(strings.ReplaceAll(n.Str, `"`, `\"`))
286286
w.print(str)
287287

288288
default:

0 commit comments

Comments
 (0)