Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid indentation, you can use tabs or spaces but not both jade

Tags:

node.js

pug

i have following jade code which works fine

div.container
  h3.entry-title(style='margin-top:25px;') #{result.post_title}
  div      
    p.text-left.pst <i class="fa fa-calendar"></i> #{result.post_date}  
  div.panel
     !{result.post_content}
    -if(typeof userType !== 'undefined' && userType=='admin')
        a.btn.red.marginTop(href='/ebs' ) Cancel               

 div.page-footer
    div.page-footer-inner
        Copyright Copyright All rights reserved.  

but when i try to insert if statement like below it gives me the indentation error

  div.container
  h3.entry-title(style='margin-top:25px;') #{result.post_title}
  div   
   -if(result.post_date!='-1')  
    p.text-left.pst <i class="fa fa-calendar"></i> #{result.post_date}  
  div.panel
     !{result.post_content}
    -if(typeof userType !== 'undefined' && userType=='admin')
        a.btn.red.marginTop(href='/ebs' ) Cancel               

 div.page-footer
    div.page-footer-inner
        Copyright Copyright  All rights reserved.
like image 521
Ammar Ijaz Avatar asked Dec 29 '25 21:12

Ammar Ijaz


1 Answers

If you are using Sublime text editor, you can go to View > Identation > Convert Identation to spaces.

like image 190
denmg Avatar answered Jan 01 '26 13:01

denmg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!