diff --git a/src/formatter.test.ts b/src/formatter.test.ts index 74439a0..412ae12 100644 --- a/src/formatter.test.ts +++ b/src/formatter.test.ts @@ -488,4 +488,26 @@ Yes! check(source, expected); stable(expected); }); + + fit('fences with block level tags', () => { + const source = `{% tab %} +\`\`\`json {% filename="package.json" %} +{ + "dependencies": { + ... + {% highlight type="remove" %} + "beta": "1.2.3", + {% /highlight %} + {% highlight type="add" %} + "main": "1.2.4", + {% /highlight %} + ... + } +} +\`\`\` +{% /tab %} +`; + + check(source, source); + }); }); diff --git a/src/formatter.ts b/src/formatter.ts index 4723960..5d3b408 100644 --- a/src/formatter.ts +++ b/src/formatter.ts @@ -185,7 +185,8 @@ function* formatNode(n: Node, o: Options = {}) { yield* formatAnnotations(n); yield NL; yield indent; - yield* formatChildren(n, no); + // TODO use formatChildren once we can differentiate inline from block tags within fences + yield n.attributes.content; // yield* formatChildren(n, no); yield indent; yield '```'; yield NL;