mirror of
https://github.com/sourcey/spectacle.git
synced 2024-09-17 16:38:10 +03:00
e11adc7f3a
Improve the way schema descriptions are rendered and linked
17 lines
688 B
JavaScript
17 lines
688 B
JavaScript
var Handlebars = require('handlebars')
|
|
var common = require('../lib/common')
|
|
|
|
/**
|
|
* 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.
|
|
*/
|
|
module.exports = function(value, options) {
|
|
value = value + ''
|
|
var html = common.markdown(value, options.hash ? options.hash.stripParagraph : false)
|
|
return new Handlebars.SafeString(html)
|
|
};
|