File tree 2 files changed +9
-1
lines changed
test/unit/modules/compiler
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ const modifierRE = /\.[^.\]]+(?=[^\]]*$)/g
38
38
const slotRE = / ^ v - s l o t ( : | $ ) | ^ # /
39
39
40
40
const lineBreakRE = / [ \r \n ] /
41
- const whitespaceRE = / \s + / g
41
+ const whitespaceRE = / [ \f \t \r \n ] + / g
42
42
43
43
const invalidAttributeRE = / [ \s " ' < > \/ = ] /
44
44
Original file line number Diff line number Diff line change @@ -865,6 +865,14 @@ describe('parser', () => {
865
865
expect ( ast . children [ 4 ] . children [ 0 ] . text ) . toBe ( '. Have fun! ' )
866
866
} )
867
867
868
+ it ( `maintains with whitespace: 'condense'` , ( ) => {
869
+ const options = extend ( { } , condenseOptions )
870
+ const ast = parse ( '<span> </span>' , options )
871
+ const code = ast . children [ 0 ]
872
+ expect ( code . type ) . toBe ( 3 )
873
+ expect ( code . text ) . toBe ( '\xA0' )
874
+ } )
875
+
868
876
it ( `preserve whitespace in <pre> tag with whitespace: 'condense'` , function ( ) {
869
877
const options = extend ( { } , condenseOptions )
870
878
const ast = parse ( '<pre><code> \n<span>hi</span>\n </code><span> </span></pre>' , options )
You can’t perform that action at this time.
0 commit comments