hbar = require './handlebars'
{Showdown} = require './showdown'
converter = new Showdown.converter
hbar.registerHelper 'format', (comment) ->
comment = comment+''
# param - info => param: info
comment = comment.replace /(?:^\s*(\S+?)\s+-\s+(.+)$)+/img,
'
**$1:** $2'
comment = comment.replace '
**', '
**'
# markdownize
comment = converter.makeHtml comment
#
code => codecomment = comment.replace /
((?:.|\n)+)<\/code><\/pre>/img,
'$1
'
new hbar.SafeString comment