src/js/markdownCommands/heading.js
function getHeadingMarkdown(text, size) {
  const foundedHeading = text.match(FIND_HEADING_RX);
  let heading = '';

  do {
    heading += '#';
    size -= 1;
  } while (size > 0);

  if (foundedHeading) {
    [, text] = text.split(foundedHeading[0]);
  }

  return `${heading} ${text}`;
}
function getHeadingMarkdown(text, size) {
  const foundedHeading = text.match(FIND_HEADING_RX);
  let heading = '';

  do {
    heading += '#';
    size -= 1;
  } while (size > 0);

  if (foundedHeading) {
    [, text] = text.split(foundedHeading[0]);
  }

  return `${heading} ${text}`;
}
function getHeadingMarkdown ( text , size ) { const foundedHeading = text . match ( FIND_HEADING_RX ) ; let heading = '' ; do { heading += '#' ; size -= 1 ; } while ( size > 0 ) ; if ( foundedHeading ) { [ , text ] = text . split ( foundedHeading [ 0 ] ) ; } return ` ${ heading } ${ text } ` ; }
Get heading markdown
@param {string} text Source test
@param {number} size size
@returns {string}
Get heading markdown