lib/markdown.js
function markdownToUnwrappedHTML(markdown) {
  const html = (0, _trim2.default)(md.render(markdown)),
        { dom, children } = (0, _jsx.parseHTML)(html);

  if (1 !== children.length) {
    return html;
  }
  const [child] = children,
        { type, name } = child;

  return 'tag' === type && 'p' === name ? dom(child).html() : html;
}
function markdownToUnwrappedHTML(markdown) {
  const html = (0, _trim2.default)(md.render(markdown)),
        { dom, children } = (0, _jsx.parseHTML)(html);

  if (1 !== children.length) {
    return html;
  }
  const [child] = children,
        { type, name } = child;

  return 'tag' === type && 'p' === name ? dom(child).html() : html;
}
function markdownToUnwrappedHTML ( markdown ) { const html = ( 0 , _trim2 . default ) ( md . render ( markdown ) ) , { dom , children } = ( 0 , _jsx . parseHTML ) ( html ) ; if ( 1 !== children . length ) { return html ; } const [ child ] = children , { type , name } = child ; return 'tag' === type && 'p' === name ? dom ( child ) . html ( ) : html ; }
Useful utilities for working with Markdown.

@module markdown
 
If a simple single line string is passed to the Markdown parser it thinks that it's a paragraph (it sort of
technically is) and unnecessarily wraps it into `<p></p>`, which most often is not the desired behavior.

This function converts Markdown to HTML and then removes the wrapping paragraph if it is the only top level tag
unwrapping its contents.

@memberof module:markdown
@private
@method markdownToUnwrappedHTML
@param {string} markdown - an arbitrary Markdown string
@return {string} an HTML string
Useful utilities for working with Markdown .