user1766555
user1766555

Reputation: 57

Why does this jade template not work with commenting?

When I use the word works, I mean by all the content showing inside the well. For some reason this jade template doesn't work if I leave the commented line in but works if I delete the commented line. Why is this happening?

extends layout

block content
  h1= title

  // div.well
        p Fill out your info
        form(method="post", action="/add")
        div.control-group.input-append
        input#name(type="text", name="name", data-required)
        label.add-on(for="name")
          | Name
        div.control-group.input-append
        input#country(type="text", name="city", data-required)
        label.add-on(for="city")
          | City
        div.control-group.input-append
        input#country(type="text", name="country")
        label.add-on(for="country")
          | Country
        div.control-group.input-append
        input#birthday(type="text", name="birthday")
        label.add-on(for="birthday")
          | Birthday
        div.control-group.input-append
        input#email(type="text", name="email")
        label.add-on(for="email")
          | Email
        button(type="submit") Submit

Upvotes: 1

Views: 108

Answers (1)

dersvenhesse
dersvenhesse

Reputation: 6424

Jade interprets your comment in that line as a comment for the whole block. So the div.well and its inner tags appear in the dom, but there commented out.

See here: http://jade-lang.com/reference/#blockcomments

Upvotes: 2

Related Questions