EmbedExtensionsComponent.registerExtensions method
EmbedExtensionsComponent › registerExtensions
Registers the specified file extensions with the given embed type in the Obsidian app. The extensions will be automatically unregistered when the component is unloaded.Signature:
registerExtensions(extensions: string[], embedCreator: EmbedCreator): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| extensions | string[] | An array of file extensions to register. |
| embedCreator | EmbedCreator | The embed creator function to associate with the extensions. |
Returns: void
Example:
component.registerExtensions(['ext1', 'ext2'], (context, file, subpath) => new MyEmbedComponent(context, file, subpath));