Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

"Unexpected token 'indent'" when using pug template #86

Closed
aleksejevski opened this issue Apr 12, 2017 · 0 comments
Closed

"Unexpected token 'indent'" when using pug template #86

aleksejevski opened this issue Apr 12, 2017 · 0 comments

Comments

@aleksejevski
Copy link

aleksejevski commented Apr 12, 2017

Expected behavior

These two templates should work the same as each other:

<template lang="pug">
  .randomContentGen`
    input(v-model="randomContent",disabled)
    button(@click="randomContentGen") Generate Content!!
</template>
<template lang="pug">
.randomContentGen
    input(v-model="randomContent",disabled)`
    button(@click="randomContentGen") Generate Content!!`
</template>

(There is no tab/space at the beginning of the first line inside the second template, but 2 inside the first template.)

Actual behavior

Only the second template can be complied. When using the first template, the second line of which starts with a tab(2 spaces), an exception is thrown on my console:

�   (vue plugin) F:\rollup-vue-test\src\components\randomContentGen.vue:2:1`
    1|
  > 2|   .randomContentGen
-------^
    3|     input(v-model="randomContent",disabled)`
    4|     button(@click="randomContentGen") Generate Content!!`
    5|

unexpected token "indent"

Steps to reproduce the behavior

@znck znck added the bug label Apr 12, 2017
aleksejevski pushed a commit to aleksejevski/rollup-plugin-vue that referenced this issue May 10, 2017
aleksejevski pushed a commit to aleksejevski/rollup-plugin-vue that referenced this issue May 10, 2017
@znck znck closed this as completed in #89 May 10, 2017
znck pushed a commit that referenced this issue May 10, 2017
* Trim templates before pug compiling (#86)

* Fix a mistake (#86)

* Add few nested tags

* Update expected output for pug.vue
znck pushed a commit that referenced this issue May 12, 2017
* add failing test case for pug

* deindent template code before preprocessor

this makes pug work consistently

* remove redundant re-deindent

* remove trim

* specify pug's doctype to use boolean attributes' terse style
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants