diff --git a/bin/marked b/bin/marked index 1197176286..18444c8306 100755 --- a/bin/marked +++ b/bin/marked @@ -10,6 +10,7 @@ var fs = require('fs') , marked = require('../'); var usage = function() { + console.log('marked - a markdown parser'); console.log(''); console.log('Usage:'); console.log(' marked [-oih] [input]'); @@ -82,12 +83,11 @@ var main = function(argv) { } } - if (!input) { + if (!input && files.length !== 1) { input = files.pop(); } - // should maybe detect tty for a repl: tty.isatty(0) - if (fs.statSync(input).ino === fs.statSync(__filename).ino) { + if (files.length === 1) { var stdin = process.openStdin() , buff = []; diff --git a/lib/marked.js b/lib/marked.js index 951786ac36..89d2aa5425 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -412,6 +412,9 @@ var tok = function() { + '>'; } case 'code': { + if (token.text[token.text.length-1] === '\n') { + token.text = token.text.slice(0, -1); + } return '
'
         + escape(token.text, true)
         + '
';