Skip to content

Commit

Permalink
Pass viewPlugins to registerEditorExtension.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Chan committed Jun 2, 2022
1 parent 2238d52 commit 3093661
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ export default class Linkify extends Plugin {
await this.saveData(this.settings);
}

// Unregisters any existing LinkifyPlugins and registers new ones constructed from the rules.
// Creates new LinkifyViewPlugins and registers them.
refreshExtensions() {
// Note: unregisterEditorExtension is not part of the public Obsidian API.
this.viewPlugins.forEach((plugin) => { (<any>this.app.workspace).unregisterEditorExtension(plugin); });
this.viewPlugins = this.settings.rules.map(createViewPlugin);
this.viewPlugins.forEach((plugin) => { this.registerEditorExtension(plugin); });
this.registerEditorExtension(this.viewPlugins)
}

// Opens linkified text as a link.
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "linkify",
"name": "Linkify",
"version": "1.0.8",
"version": "1.0.9",
"minAppVersion": "0.13.0",
"description": "Converts matching text into links.",
"author": "matthewhchan",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkify",
"version": "1.0.8",
"version": "1.0.9",
"description": "Turns strings into links.",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit 3093661

Please sign in to comment.