Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
White space stripped between <a> and <span> where it shouldn't (in comparison to HTML) #9127
Steps to reproduce
When using two tags like and in a template of a single file component, with some white space in between.
Examples (as in the link)
<div> <br /> <a href="https://vuejs.org/">Vue.js</a> <span>is nice</span>. </div>
results in `Vue.jsis nice.'
What is expected?
Expected is the regular handling of white space in browsers that remove all, but one white space.
What is actually happening?
The last space is removed.
https://codepen.io/anon/pen/RqEoOr shows the regular handling of this piece of html in a browser (without other css options set).
The problem was noticed when trying to translate text with vue-gettext, where is poses an extra challenge, see Polyconseil/vue-gettext#80
@Justineo thanks for the pointer to the issue! I did search the tracker, but missed it.
However I disagree with that this is resolved. I'm continuing here, because the reproduction link of #9021 does not work anymore and here are different details that explain why this is a problem to vue users.
Part of the problem is that render behaviour of browsers would usually leave on space in,
<span> a </span> <span> b </span>
and Vue components cannot be easily written to behave the same, because