title: Unexpected token Indent
body: <p>I am writting a javascript function in my route which uses some html that is kept in tran.jade file but it gives indent error when i run it on browser. Basically i want to create a function in router that make calculation on students marks and then return a view using express. Please guide me if im doing it the wrong way.</p>
  
  <pre><code>      var express = require('express');
        var router = express.Router();
  
         /* GET home page. */
         router.get('/', function(req, res, next) {
         res.render('index', { title: 'Express' });
         });
         router.get('/tran', function(req, res, next) {
         var grade = "";  //declare a variable for grade
          var  result="";  //declare a variable for result
  
          //read the marks
          var engMarks = document.getElementById('txtEnglish').value;
          var kannadaMarks = 
          document.getElementById('txtKannada').value;
          var mathsMarks = document.getElementById('txtMaths').value;
          var scienceMarks = 
          document.getElementById('txtScience').value;
  
          //calculate the total marks (using double notation technique)
           var totalMarks = engMarks - (- kannadaMarks) - (- mathsMarks) 
          - (- scienceMarks);
  
          //get the average marks
          var averageMarks = totalMarks / 4;                  
  
          //find the grade and result using the ternary operator inside 
          the switch statement                  
          switch(
  
  
                  //usage of ternary operator inside switch
  
                  (averageMarks &gt; 60 &amp;&amp; averageMarks &lt;= 100) ? 1 : 
                  (averageMarks &gt; 50 &amp;&amp; averageMarks &lt; 60) ? 2 : 
                  (averageMarks &gt; 40 &amp;&amp; averageMarks &lt; 50) ? 3 : 0 
                )
  
                  {
                      case 1 :grade = "A";result="First Class";break;
                      case 2 :grade = "B"; result="Second Class";break;
                      case 3 :grade = "C"; result="Third Class";break;
                      case 0 :grade = "D"; result="Fail";break;
                  }
  
  
          //display the results   
          document.getElementById('txtStudentName').value = 
          document.getElementById('txtName').value;
          document.getElementById('txtStudentClass').value = 
          document.getElementById('txtClass').value;
          document.getElementById('txtTotalMarks').value = totalMarks;
          document.getElementById('txtAvgMarks').value = averageMarks;
          document.getElementById('txtGrade').value = grade;
          document.getElementById('txtResult').value = result;
          res.render('tran');
  
          }
          );
  
  
          module.exports = router;
  </code></pre>