module CKEditor5::Rails::Presets::Concerns::PluginMethods

def patch_plugin(plugin)

Other tags:
    Example: Apply patch for specific CKEditor versions -

Returns:
  • (Editor::PropsPatchPlugin, nil) - Returns plugin if registered, nil if not applicable

Raises:
  • (InvalidPatchPluginError) - When provided plugin is not a PropsPatchPlugin

Parameters:
  • plugin (Editor::PropsPatchPlugin) -- Patch plugin instance to register
def patch_plugin(plugin)
  unless plugin.is_a?(Editor::PropsPatchPlugin)
    raise InvalidPatchPluginError, 'Provided plugin must be a PropsPatchPlugin instance'
  end
  return unless !@version || plugin.applicable_for_version?(@version)
  register_plugin(plugin)
end