code: function(matchRules, text, change) {
    const { startOffset, endOffset, focusText } = change.state;
    const focusedText = focusText.text;
    change.moveOffsetsTo(0);
    let length = 0;
    for (let i = 0, k = matchRules.length; i < k; i++) {
      const result = matchRules[i].exec(focusedText);
      if (result) {
        length = result[0].length;
        change.deleteForward(length);
        break;
      }
    }
    const startPos = Math.max(startOffset + text.length - length, 0);
    const endPos = Math.max(endOffset + text.length - length, 0);
    change.insertText(text).moveOffsetsTo(startPos, endPos).focus();
  
    return change;
  }
docs: Wrap block
  
  @param matchRules - list of regexp
  @param text - marker of the block
  @param change - editor change
  @returns {Object} - state