diff --git a/src/printer.ts b/src/printer.ts index edfa189e..77e8f789 100644 --- a/src/printer.ts +++ b/src/printer.ts @@ -450,7 +450,12 @@ export class PugPrinter { } private frameworkFormat(code: string): string { - const options: Options = { ...this.codeInterpolationOptions }; + const options: Options = { + ...this.codeInterpolationOptions, + // we need to keep the original singleQuote option + // see https://github.com/prettier/plugin-pug/issues/339 + singleQuote: this.options.singleQuote, + }; switch (this.framework) { case 'angular': options.parser = '__ng_interpolation'; @@ -461,7 +466,6 @@ export class PugPrinter { options.parser = 'babel'; options.semi = false; } - let result: string = format(code, options); if (result[0] === ';') { result = result.slice(1);