Sign up (with export icon)

watchdog/utils/normalizerootsconfig

Api-module iconmodule

Functions

  • Chevron-right icon

    normalizeRootsConfig( sourceElementsOrData, config, defaultRootName ) → void
    internal

    Normalizes the editor roots configuration. It ensures that all root configurations are defined in config.roots and that they have initialData defined.

    It normalizes a single-root configuration (where config.root is used) to a multi-root configuration (where all roots are defined in config.roots). This is considered a standard configuration format, so the editor features can always expect roots to be defined in config.roots.

    It also handles legacy configuration options, such as config.initialData, config.placeholder, and config.label.

    Parameters

    sourceElementsOrData: string | HTMLElement | Record<string, string> | Record<string, HTMLElement>
    config: EditorConfig
    defaultRootName: string | false

    Returns

    void