-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Parser fails on tags with one space inside a <pre> tag #4758
Labels
Comments
A slightly modified test like this one triggers the error. vue/test/unit/modules/compiler/parser.spec.js Lines 482 to 490 in 08bd81f
it('preserve whitespace in <pre> tag', function () {
const options = extend({}, baseOptions)
const ast = parse('<pre><code> \n<span> </span>\n </code></pre>', options)
const code = ast.children[0]
expect(code.children[0].type).toBe(3)
expect(code.children[0].text).toBe(' \n')
expect(code.children[2].type).toBe(3)
expect(code.children[2].text).toBe('\n ')
}) I also pinpoint this line, that has a comment that describes the problem. vue/packages/vue-template-compiler/build.js Lines 1373 to 1376 in 80a7cea
|
Hey! thanks!, that was fast! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vue.js version
2.1.10
Reproduction Link
https://jsfiddle.net/blackjid/br2h9pko/1/
Steps to reproduce
Have and element with just one space inside a
<pre>
tag element.and initialize vue in a parent element
What is Expected?
Vue initializes correctly.
What is actually happening?
An exception is thrown.
What did I try
v-pre
attribute to the<pre>
tag or to a wrapper element. This didn't work either
. This worked, but you don't always control the code that you are bootstrapping vue on.The text was updated successfully, but these errors were encountered: