Skip to content

Allow nested code fences #19873

Open
Open
@FrederikBolding

Description

@FrederikBolding

We may want to consider allowing nested code fences, so we can avoid code looking like this due to more feature flags being added over time:

///: BEGIN:ONLY_INCLUDE_IN(snaps)
export function removeSnap(
  snapId: string,
): ThunkAction<void, MetaMaskReduxState, unknown, AnyAction> {
  return async (
    dispatch: MetaMaskReduxDispatch,
    ///: END:ONLY_INCLUDE_IN
    ///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps)
    getState,
    ///: END:ONLY_INCLUDE_IN
    ///: BEGIN:ONLY_INCLUDE_IN(snaps)
  ) => {
    dispatch(showLoadingIndication());
    ///: END:ONLY_INCLUDE_IN
    ///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps)
    const subjects = getPermissionSubjects(getState()) as {
      [k: string]: { permissions: Record<string, any> };
    };

    const isAccountsSnap =
      subjects[snapId]?.permissions?.snap_manageAccounts !== undefined;
    ///: END:ONLY_INCLUDE_IN

   (...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions