compiler-core: Is it correct to remove whitespace between two elements?
Version
3.1.4
Reproduction link
Steps to reproduce
<span>a</span>
<span>b</span>
<span>c</span>
What is expected?
Consistent with browser behavior. shown as 'a b c'
What is actually happening?
'abc'
these code in native html will be shown as 'a b c'. But in vue they will be shown as 'abc', no whitespace. Is it a bug or feature?
removing whitespace is an optimization and simplification process to reduce the amount of nodes vue has to deal with.
you will have to find your own workaround, there is no easy way disabling whitespace removal except by a compiler option, which effect the whole project.
<span>a </span>
<span>b </span>
<span>c </span>
or putting all elements on the same line, as noted in https://github.com/vuejs/vue-next/issues/2431