diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/serve.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js index eb8610c..f146c49 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -2332,6 +2332,16 @@ Serve.prototype.wrapBinary = function (opts) { src: opts.rawUrl }) } + if (type === 'text/markdown') { + // TODO: rewrite links to files/images to be correct + return ph('blockquote', u.readNext(function (cb) { + pull.collect(function (err, bufs) { + if (err) return cb(pull.error(err)) + var text = Buffer.concat(bufs).toString('utf8') + return cb(null, pull.once(self.app.render.markdown(text))) + })(read) + })) + } return ph('pre', pull.map(function (buf) { return self.app.render.highlight(buf.toString('utf8'), ext) })(read)) |