Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

horizontal-tab in attribute argument causes 'Error compiling template' in Internet Explorer and Edge #6916

Closed
PhKi opened this issue Oct 25, 2017 · 0 comments

Comments

@PhKi
Copy link

PhKi commented Oct 25, 2017

Version

2.5.2

Reproduction link

https://jsfiddle.net/50wL7mdz/71870/

Steps to reproduce

this is the html that does not work:

<div id="app">
  <div v-bind:class="true
  &#09;? 'a'
  : ''
  "></div>
</div>

this is the html that does work:

<div id="app">
  <div v-bind:class="true
  ? 'a'
  : ''
  "></div>
</div>

this is the JavaScript:

new Vue({
  el: '#app'
})

What is expected?

Vue should be able to compile the template no matter if a horizontal-tab is in the attribute or not

What is actually happening?

vue fails to compile template:

[Vue warn]: Error compiling template:

<div id="app">
  <div v-bind:class="true&#10;  &#9;? 'a'&#10;  : ''&#10;  "></div>
</div>

- invalid expression: Invalid character in

    true
  &#9;? 'a'
  : ''
  

  Raw expression: v-bind:class="true
  &#9;? 'a'
  : ''
  "



(found in <Root>)
vue.js (577,7)

This happens in Internet Explorer and Edge.

It works in Chrome and Firefox.

Its related to this Bug:

:style with multiline attribute removes root element in all versions of IE #3663

which has been fixed in:

handle multiline atribute value parsing in IE (fix #3663)

As seen in the error message it doesnt complain when there are &#10; in the template, but does on &#09;.

I ran into this bug because i write long attributes in multiple lines and use horizontal-tabs to indent these lines so its easier to read.

erweixin pushed a commit to erweixin/vue that referenced this issue Dec 15, 2017
lovelope pushed a commit to lovelope/vue that referenced this issue Feb 1, 2018
f2009 pushed a commit to f2009/vue that referenced this issue Jan 25, 2019
aJean pushed a commit to aJean/vue that referenced this issue Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants