Jade imprint errors

So, for my Express site, I use jade. So I decided to try changing the layout file so that I could start developing my site. I changed the layout source code (which worked), but I started getting indentation errors in any file that extends the layout as follows:

500 Error: /home/kevin/Blue/views/layout.jade:6 4| p Hello World Invalid indentation, you can use tabs or spaces but not both 4| p Hello World Invalid indentation, you can use tabs or spaces but not both at Object.Lexer.indent (/home/kevin/Blue/node_modules/jade/lib/lexer.js:679:15) at Object.Lexer.next (/home/kevin/Blue/node_modules/jade/lib/lexer.js:777:15) at Object.Lexer.lookahead (/home/kevin/Blue/node_modules/jade/lib/lexer.js:107:46) at Object.Parser.lookahead (/home/kevin/Blue/node_modules/jade/lib/parser.js:115:23) at Object.Parser.peek (/home/kevin/Blue/node_modules/jade/lib/parser.js:92:17) at Object.Parser.tag (/home/kevin/Blue/node_modules/jade/lib/parser.js:640:22) at Object.Parser.parseTag (/home/kevin/Blue/node_modules/jade/lib/parser.js:624:17) at Object.Parser.parseExpr (/home/kevin/Blue/node_modules/jade/lib/parser.js:198:21) at Object.Parser.block (/home/kevin/Blue/node_modules/jade/lib/parser.js:592:25) at Object.Parser.tag (/home/kevin/Blue/node_modules/jade/lib/parser.js:721:26) 

So I have the code:

index.jade

 extends layout block content p Hello World 

and

 doctype 5 html head title= title link(rel='stylesheet', href='/stylesheets/style.css') body div#header p This is the header block content 

Keep in mind that I didnโ€™t do anything wrong, and I know how to properly link files using the extends option. In fact, the code worked fine until I started messing with the layout file. All of this is basically a problem. I tried to find out if this is a text editor causing this problem, and I could not figure out if this is because I cannot get the code to work again.

I am using the sublime text 2 editor to write this jade code. If the text editor is not backing down correctly, can someone help me find out how to fix it?

+7
javascript indentation sublimetext2 pug express
source share
2 answers

In the lower right corner of Sublime Text there should be a label with the inscription Spaces: N or Tab Size: N , where N is the number. Select this and you will see options for converting the entire print of the document to use tabs or spaces:

  • Convert Indentation to Spaces
  • Convert Indentation to Tabs
+49
source share

for an edit form on a server.js file set variable like this

 var applications = row; res.render("edit", { applications : applications[0] }); 

for edit.jade file:

 block content table thead tr th First Name th Last Name tbody - each item in applications tr td= item.username td= item.email 
0
source share

All Articles