Skip to content

Commit f709238

Browse files
committed
chore: use correct parse in parser tests for whitespace: condense
1 parent 140a768 commit f709238

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: packages/compiler-core/__tests__/parse.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ describe('compiler: parse', () => {
21662166
})
21672167

21682168
test('should remove leading newline character immediately following the pre element start tag', () => {
2169-
const ast = baseParse(`<pre>\n foo bar </pre>`, {
2169+
const ast = parse(`<pre>\n foo bar </pre>`, {
21702170
isPreTag: tag => tag === 'pre',
21712171
})
21722172
expect(ast.children).toHaveLength(1)
@@ -2176,7 +2176,7 @@ describe('compiler: parse', () => {
21762176
})
21772177

21782178
test('should NOT remove leading newline character immediately following child-tag of pre element', () => {
2179-
const ast = baseParse(`<pre><span></span>\n foo bar </pre>`, {
2179+
const ast = parse(`<pre><span></span>\n foo bar </pre>`, {
21802180
isPreTag: tag => tag === 'pre',
21812181
})
21822182
const preElement = ast.children[0] as ElementNode
@@ -2187,7 +2187,7 @@ describe('compiler: parse', () => {
21872187
})
21882188

21892189
test('self-closing pre tag', () => {
2190-
const ast = baseParse(`<pre/><span>\n foo bar</span>`, {
2190+
const ast = parse(`<pre/><span>\n foo bar</span>`, {
21912191
isPreTag: tag => tag === 'pre',
21922192
})
21932193
const elementAfterPre = ast.children[1] as ElementNode
@@ -2196,7 +2196,7 @@ describe('compiler: parse', () => {
21962196
})
21972197

21982198
test('should NOT condense whitespaces in RCDATA text mode', () => {
2199-
const ast = baseParse(`<textarea>Text:\n foo</textarea>`, {
2199+
const ast = parse(`<textarea>Text:\n foo</textarea>`, {
22002200
parseMode: 'html',
22012201
})
22022202
const preElement = ast.children[0] as ElementNode

Diff for: packages/compiler-core/src/options.ts

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export interface ParserOptions
7474
delimiters?: [string, string]
7575
/**
7676
* Whitespace handling strategy
77+
* @default 'condense'
7778
*/
7879
whitespace?: 'preserve' | 'condense'
7980
/**

0 commit comments

Comments
 (0)