src/js/wysiwygCommands/codeBlock.js
function getCodeBlockBody(range, wwe) {
  const mgr = wwe.componentManager.getManager('codeblock');
  let codeBlock;
  if (range.collapsed) {
    codeBlock = '<br>';
  } else {
    const contents = range.extractContents();
    const nodes = util.toArray(contents.childNodes);
    const tempDiv = $('<div>').append(mgr.prepareToPasteOnCodeblock(nodes));
    codeBlock = tempDiv.html();
  }

  return codeBlock;
}
function getCodeBlockBody(range, wwe) {
  const mgr = wwe.componentManager.getManager('codeblock');
  let codeBlock;
  if (range.collapsed) {
    codeBlock = '<br>';
  } else {
    const contents = range.extractContents();
    const nodes = util.toArray(contents.childNodes);
    const tempDiv = $('<div>').append(mgr.prepareToPasteOnCodeblock(nodes));
    codeBlock = tempDiv.html();
  }

  return codeBlock;
}
function getCodeBlockBody ( range , wwe ) { const mgr = wwe . componentManager . getManager ( 'codeblock' ) ; let codeBlock ; if ( range . collapsed ) { codeBlock = '<br>' ; } else { const contents = range . extractContents ( ) ; const nodes = util . toArray ( contents . childNodes ) ; const tempDiv = $ ( '<div>' ) . append ( mgr . prepareToPasteOnCodeblock ( nodes ) ) ; codeBlock = tempDiv . html ( ) ; } return codeBlock ; }
getCodeBlockBody
get text wrapped by code
@param {object} range range object
@param {object} wwe wysiwyg editor
@returns {string}
getCodeBlockBody get text wrapped by code