I assign a string with html tags to a newly created div:
const wrapper = document.createElement('div')
wrapper.innerHTML = this.html
this.html looks like this (please note the whitespace in the span.b tag):
<span class="a"></span><span class="b" data-topicId="mark.001" data-type="R">
</span><span class="c"><span class="d">
After the innerHTML assignment I render the HTML with vue:
return {
name: 'NormalizedContent',
template: wrapper.outerHTML,
[...]
}
up until the last wrapper.outerHTML I can see multiple (at least one) whitespace with console.log, after it is rendered, the whitespace is gone.
I want to keep at least one and I can't replace them programmatically e.g. with .