/**
 * Checks if a particular node fragment is supported in the parent
 * @param state EditorState
 * @param fragment The fragment to be checked for
 */
export const isSupportedInParent = (state, fragment, currentAppearance) => {
  const depth = currentAppearance === 'embed' || currentAppearance === 'block' ? undefined : -1;
  const parent = state.selection.$from.node(depth);
  return parent && parent.type.validContent(fragment);
};