Skip to content

"<" in pug doesn't work #3973

@puxxustc

Description

@puxxustc

env

macOS 10.12.1 Beta
nodejs 6.8.1
vuejs 2.0.3

Steps to reproduce

init a test vue project with default options

vue init webpack test
cd test

edit src/components/Hello.vue

<template lang="pug">
div
  div(v-if!="0 < 0")
</template>

<script>
export default {
}
</script>

then run dev server

npm run dev

What is actually happening?

got error:


> test@1.0.0 dev /Users/xiaoxiao/test
> node build/dev-server.js

Listening at http://localhost:8080

webpack: wait until bundle finished: /index.html
webpack built 65f1e5f2bb987f85bda4 in 2618ms
Hash: 65f1e5f2bb987f85bda4
Version: webpack 1.13.2
Time: 2618ms
 Asset    Size  Chunks       Chunk Names
app.js  867 kB       0       app

ERROR in ./src/components/Hello.vue
Module build failed: Error: Error parsing template:

< 0")
</template>

<script>
export default {
}
</script>

    at parseHTML (/Users/xiaoxiao/test/node_modules/vue-template-compiler/build.js:3434:13)
    at Object.parseComponent (/Users/xiaoxiao/test/node_modules/vue-template-compiler/build.js:5171:3)
    at module.exports (/Users/xiaoxiao/test/node_modules/vue-loader/lib/parser.js:15:21)
    at Object.module.exports (/Users/xiaoxiao/test/node_modules/vue-loader/lib/loader.js:145:15)
 @ ./~/babel-loader!./~/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue 7:13-42
Child html-webpack-plugin for "index.html":
         Asset     Size  Chunks       Chunk Names
    index.html  1.46 MB       0
webpack: bundle is now VALID.

description

Similar issue: #3731 . However, situations are not the same. Replace "<" with ">" won't trigger this error. It's not a bug of pug as the error occurs before pug was called. In fact, this error happens even if pug is not installed.

Thanks for your time to review this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions