diff --git a/packages/compiler-core/__tests__/parse.spec.ts b/packages/compiler-core/__tests__/parse.spec.ts index 77211b2f5fb..4e5a9616511 100644 --- a/packages/compiler-core/__tests__/parse.spec.ts +++ b/packages/compiler-core/__tests__/parse.spec.ts @@ -2369,6 +2369,7 @@ describe('compiler: parse', () => { test('should remove leading newline character immediately following the pre element start tag', () => { const ast = parse(`
\n foo bar`, { isPreTag: tag => tag === 'pre', + isIgnoreNewlineTag: tag => tag === 'pre', }) expect(ast.children).toHaveLength(1) const preElement = ast.children[0] as ElementNode diff --git a/packages/compiler-core/src/options.ts b/packages/compiler-core/src/options.ts index 16b35d3ee85..1de865f42eb 100644 --- a/packages/compiler-core/src/options.ts +++ b/packages/compiler-core/src/options.ts @@ -52,6 +52,11 @@ export interface ParserOptions * e.g. elements that should preserve whitespace inside, e.g. `
` */ isPreTag?: (tag: string) => boolean + /** + * Elements that should ignore the first newline token per parinsg spec + * e.g. `