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

Trim templates before pug compiling (#86) #89

Merged
merged 4 commits into from
May 10, 2017
Merged

Conversation

aleksejevski
Copy link

Fixes #86 .

Changes proposed in this pull request:

  • Trim templates code before pug-template compiling, so that the compiler works correctly however many indent before the first letter of the very first line.

/ping @znck

@znck znck merged commit 855006b into vuejs:master May 10, 2017
@HerringtonDarkholme
Copy link
Member

HerringtonDarkholme commented May 10, 2017

Just some pedantic comment. Since it only trims the leading space, I wonder if it works for multiple root(used with if) pug file. Like

<template>
  div(v-if="true")
    p some text
  span(v-else)
    span otherwise
</template>

This will be trimmed to

div(v-if="true")
    p some text
  span(v-else)
    span otherwise

Which seems wrong.

@znck
Copy link
Member

znck commented May 11, 2017

I had this concern. I tried updating the test case (^^Not a pug user).

I think deindent would be better.

@HerringtonDarkholme Could you add a failing test case?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants