handlebars/helpers.js
function (value, options) {
    if (!value) {
      return value
    }
    var html = marked(value)
    // We strip the surrounding <p>-tag, if
    if (options.hash && options.hash.stripParagraph) {
      var $ = cheerio('<root>' + html + '</root>')
      // Only strip <p>-tags and only if there is just one of them.
      if ($.children().length === 1 && $.children('p').length === 1) {
        html = $.children('p').html()
      }
    }
    return new Handlebars.SafeString(html)
  }
function (value, options) {
    if (!value) {
      return value
    }
    var html = marked(value)
    // We strip the surrounding <p>-tag, if
    if (options.hash && options.hash.stripParagraph) {
      var $ = cheerio('<root>' + html + '</root>')
      // Only strip <p>-tags and only if there is just one of them.
      if ($.children().length === 1 && $.children('p').length === 1) {
        html = $.children('p').html()
      }
    }
    return new Handlebars.SafeString(html)
  }
function ( value , options ) { if ( ! value ) { return value } var html = marked ( value ) // We strip the surrounding <p>-tag, if if ( options . hash && options . hash . stripParagraph ) { var $ = cheerio ( '<root>' + html + '</root>' ) // Only strip <p>-tags and only if there is just one of them. if ( $ . children ( ) . length === 1 && $ . children ( 'p' ) . length === 1 ) { html = $ . children ( 'p' ) . html ( ) } } return new Handlebars . SafeString ( html ) }
Render a markdown-formatted text as HTML.
@param {string} `value` the markdown-formatted text
@param {boolean} `options.hash.stripParagraph` the marked-md-renderer wraps generated HTML in a <p>-tag by default.
If this options is set to true, the <p>-tag is stripped.
@returns {Handlebars.SafeString} a Handlebars-SafeString containing the provieded
markdown, rendered as HTML.
Render a markdown - formatted text as HTML .