Last active
          June 29, 2018 09:42 
        
      - 
      
 - 
        
Save joelanman/263cbe51c6a33712f1ebfa697fa36d13 to your computer and use it in GitHub Desktop.  
    how to use marked
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const express = require('express') | |
| const router = express.Router() | |
| const marked = require('marked') | |
| // Route index page | |
| router.get('/', function (req, res) { | |
| res.render('index') | |
| }) | |
| // Add your routes here - above the module.exports line | |
| router.post('/admin/plan-types/create/todo/main-content-preview', function (req, res){ | |
| req.session.data['todo-main-content-rendered'] = marked(req.session.data['todo-main-content']) | |
| res.redirect('/admin/plan-types/create/todo/main-content-preview') | |
| }) | |
| module.exports = router | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment