]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: use correct parse in parser tests for whitespace: condense
authorEvan You <yyx990803@gmail.com>
Mon, 15 Apr 2024 03:35:05 +0000 (11:35 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 15 Apr 2024 03:35:05 +0000 (11:35 +0800)
packages/compiler-core/__tests__/parse.spec.ts
packages/compiler-core/src/options.ts

index d5bdb4bc5fdb4ca2db3d735f7bba38376beac402..882133a53872ed740a4b23e2c06bfe9fb19999f6 100644 (file)
@@ -2166,7 +2166,7 @@ describe('compiler: parse', () => {
     })
 
     test('should remove leading newline character immediately following the pre element start tag', () => {
-      const ast = baseParse(`<pre>\n  foo  bar  </pre>`, {
+      const ast = parse(`<pre>\n  foo  bar  </pre>`, {
         isPreTag: tag => tag === 'pre',
       })
       expect(ast.children).toHaveLength(1)
@@ -2176,7 +2176,7 @@ describe('compiler: parse', () => {
     })
 
     test('should NOT remove leading newline character immediately following child-tag of pre element', () => {
-      const ast = baseParse(`<pre><span></span>\n  foo  bar  </pre>`, {
+      const ast = parse(`<pre><span></span>\n  foo  bar  </pre>`, {
         isPreTag: tag => tag === 'pre',
       })
       const preElement = ast.children[0] as ElementNode
@@ -2187,7 +2187,7 @@ describe('compiler: parse', () => {
     })
 
     test('self-closing pre tag', () => {
-      const ast = baseParse(`<pre/><span>\n  foo   bar</span>`, {
+      const ast = parse(`<pre/><span>\n  foo   bar</span>`, {
         isPreTag: tag => tag === 'pre',
       })
       const elementAfterPre = ast.children[1] as ElementNode
@@ -2196,7 +2196,7 @@ describe('compiler: parse', () => {
     })
 
     test('should NOT condense whitespaces in RCDATA text mode', () => {
-      const ast = baseParse(`<textarea>Text:\n   foo</textarea>`, {
+      const ast = parse(`<textarea>Text:\n   foo</textarea>`, {
         parseMode: 'html',
       })
       const preElement = ast.children[0] as ElementNode
index 8a989a8c659f0d4925c13632ef60dcaefac21bed..5a8cd0079b950594b3a3ac7d007cac36e9493323 100644 (file)
@@ -74,6 +74,7 @@ export interface ParserOptions
   delimiters?: [string, string]
   /**
    * Whitespace handling strategy
+   * @default 'condense'
    */
   whitespace?: 'preserve' | 'condense'
   /**