Grouped extensions module is throwing errors in console and notifications: all extensions already rendered as markdown, this is critical bug even within context of notice before usage of this module.
Example
plugin:unitade:707 Error: Attempting to register an existing view type "exe"
at t.registerView (app.js:1:1986951)
at t.registerView (app.js:1:2238139)
at _UNITADE_PLUGIN.__apply (plugin:unitade:702:14)
at _UNITADE_PLUGIN.eval (plugin:unitade:683:12)
at Generator.next (<anonymous>)
at fulfilled (plugin:unitade:60:24)
Solution:
Rewrite __applyCfg() function and remove preset of view: 'markdown in it's code;
Call __applyCfg() and not __tryApply() in grouped extension module within array by key or just extensions by view;
Starting from L#175 of main.ts:
private __apply(): void {
if (this.settings.is_grouped) {
const data: { [key: string]: string[] } = parsegroup(this.settings.grouped_extensions);
for (const view in data) {
this.__applyCfg(data[view].join(';'), view);
}
}
if (this.is_mobile) {
this.__applyCfg(this.settings.mobile_settings.extensions ?? this.settings.extensions, 'markdown');
} else {
this.__applyCfg(this.settings.extensions, 'markdown');
}
const forced_extensions = this.settings.forced_extensions.split(';').map(s => s.trim());
for (const extension of forced_extensions) {
try {
this.registerView(extension, (leaf: WorkspaceLeaf) => {
return new UNITADE_VIEW(leaf, extension);
});
} catch (err: any) {
new Notification('Error from UNITADE plugin:', { body: `${err}` });
console.error(err);
}
}
}
This is not perfect clear solution, but it fixes the global problem of parallel rendering everything as markdown.
Version of an project's essence
2.0.0
On what OS you have encountered the bug.
Windows
Code of conduct
[X] I agree to follow this project's code of conduct
Contact details
No response
What the essence of the bug
Grouped extensions module is throwing errors in console and notifications: all extensions already rendered as markdown, this is critical bug even within context of notice before usage of this module.
Example
Solution:
__applyCfg()
function and remove preset ofview: 'markdown
in it's code;__applyCfg()
and not__tryApply()
in grouped extension module within array by key or just extensions by view;Starting from L#175 of
main.ts
:This is not perfect clear solution, but it fixes the global problem of parallel rendering everything as markdown.
Version of an project's essence
2.0.0
On what OS you have encountered the bug.
Windows
Code of conduct
Issue policy