function _isFromCodeBlockInCodeMirror(cm, source, eventData) {
  // cursor in codeblock in markdown editor
  let fromCodeBlockInCodeMirror = source === 'markdown' && cm.getTokenAt(eventData.from).state.overlay.codeBlock;
  // or codeblock editor
  fromCodeBlockInCodeMirror = fromCodeBlockInCodeMirror || (source === 'codeblock');
  // but not from wysiwyg
  fromCodeBlockInCodeMirror = fromCodeBlockInCodeMirror && (source !== 'wysiwyg');

  return fromCodeBlockInCodeMirror;
}
function _isFromCodeBlockInCodeMirror(cm, source, eventData) {
  // cursor in codeblock in markdown editor
  let fromCodeBlockInCodeMirror = source === 'markdown' && cm.getTokenAt(eventData.from).state.overlay.codeBlock;
  // or codeblock editor
  fromCodeBlockInCodeMirror = fromCodeBlockInCodeMirror || (source === 'codeblock');
  // but not from wysiwyg
  fromCodeBlockInCodeMirror = fromCodeBlockInCodeMirror && (source !== 'wysiwyg');

  return fromCodeBlockInCodeMirror;
}
function _isFromCodeBlockInCodeMirror ( cm , source , eventData ) { // cursor in codeblock in markdown editor let fromCodeBlockInCodeMirror = source === 'markdown' && cm . getTokenAt ( eventData . from ) . state . overlay . codeBlock ; // or codeblock editor fromCodeBlockInCodeMirror = fromCodeBlockInCodeMirror || ( source === 'codeblock' ) ; // but not from wysiwyg fromCodeBlockInCodeMirror = fromCodeBlockInCodeMirror && ( source !== 'wysiwyg' ) ; return fromCodeBlockInCodeMirror ; }
determine the event is from codeblock in markdown/codeblock editor
@param {CodeMirror} cm - markdown codemirror editor
@param {string} source - event source
@param {Object} eventData - event data
@returns {boolean} - true for the event from codeblock in markdown/codeblock editor
@ignore
determine the event is from codeblock in markdown / codeblock editor
Check if the cursor is in code block in codeMirror