injectReferencesToNotes(notes: Notes): Promise<Notes> {
    return this.injectReferencesToMarkup(notes.parts).then((parts) =>
      produce(notes, (draft) => {
        draft.parts = castDraft(parts)
      })