Node.js + jade - the link closes automatically and should not contain content

I mean the next excellent MEAN stack tutorial.

Now I am facing a problem related to the template (JADE), which I cannot solve :( Can you plz look and help me if possible.

http://www.ibm.com/developerworks/library/wa-nodejs-polling-app/

    doctype 5
    html(lang='en')
      head
        meta(charset='utf-8')
        meta(name='viewport', content='width=device-width, 
initial-scale=1, user-scalable=no')
        title= title
        link(rel='stylesheet', href='//netdna.bootstrapcdn.com/bootstrap/3.0.1/
css/bootstrap.min.css')
        link(rel='stylesheet', href='/stylesheets/style.css')                
      body
        nav.navbar.navbar-inverse.navbar-fixed-top(role='navigation')
          div.navbar-header
            a.navbar-brand(href='#/polls')= title
        div.container
          div

I get this exception. I tried a couple of changes, but still could not solve it.

Error: C:\DevEnv\UT3_Node\HelloWorldNodeProject\views\index.jade:14
    12|         a.navbar-brand(href='#/polls')= title
    13|     div.container
  > 14|       div

**link is self closing and should not have content.**

Thanks in adv.

+3
source share
3 answers

Your problem in this line:

link(rel='stylesheet', href='/stylesheets/style.css')                

You cannot see it very well in StackOverflow, but after the tag you have a bunch of spaces.

Spaces here are replaced by _:

link(rel='stylesheet', href='/stylesheets/style.css')________________

So your jade will create something like:

<link rel="stylesheet" href="/stylesheets/style.css">________________</link>

, <link> .

+8
a.navbar-brand(href='#/polls')= title 

title

a.navbar-brand(href='#/polls')=title 
+1

Node.js. - . , ( .) div , , . , include, , . , . , .
, JADE.

0

All Articles