diff --git a/src/prettyprint.ts b/src/prettyprint.ts index 109ab3b..ea978f5 100644 --- a/src/prettyprint.ts +++ b/src/prettyprint.ts @@ -64,7 +64,11 @@ export function format(src: string, indentation: number = 4, useSpaces: boolean } let visitor: Visitor = { - visitElement: function (element) { + visitElement: function (element, context: any) { + if (context.skipFormattingChildren) { + pretty.push(getFromSource(element.sourceSpan)); + return; + } if (pretty.length > 0) { pretty.push('\n'); }