mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Fix 53482 : Preserve newline/space behavior (#53732)
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
This commit is contained in:
@@ -4875,7 +4875,10 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
|
||||
}
|
||||
|
||||
function emitEmbeddedStatement(parent: Node, node: Statement) {
|
||||
if (isBlock(node) || getEmitFlags(parent) & EmitFlags.SingleLine) {
|
||||
if (isBlock(node) ||
|
||||
getEmitFlags(parent) & EmitFlags.SingleLine ||
|
||||
preserveSourceNewlines && !getLeadingLineTerminatorCount(parent, node, ListFormat.None)
|
||||
) {
|
||||
writeSpace();
|
||||
emit(node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user