insertReference (data, currentReference, options = {}) {
    const editorSession = this.api.getEditorSession()
    const doc = editorSession.getDocument()
    const root = doc.root
    let insertPos = root.references.length
    if (currentReference) {
      insertPos = currentReference.getPosition() + 1
    }
    const nodeData = Object.assign({}, data, { type: 'reference' })
    return this.api.insertNode([root.id, 'references'], insertPos, nodeData, options)
  }
@param {object} data from ReferenceModal state
@param {object} currentReference