watchdog/utils/normalizerootsconfig
module
Functions
normalizeRootsConfig( sourceElementsOrData, config, defaultRootName ) → voidinternalmodule:watchdog/utils/normalizerootsconfig~normalizeRootsConfigNormalizes the editor roots configuration. It ensures that all root configurations are defined in
config.rootsand that they haveinitialDatadefined.It normalizes a single-root configuration (where
config.rootis used) to a multi-root configuration (where all roots are defined inconfig.roots). This is considered a standard configuration format, so the editor features can always expect roots to be defined inconfig.roots.It also handles legacy configuration options, such as
config.initialData,config.placeholder, andconfig.label.Parameters
sourceElementsOrData : string | HTMLElement | Record<string, string> | Record<string, HTMLElement>config : EditorConfigdefaultRootName : string | false
Returns
void