Skip to content

Commit

Permalink
live preview decoration now also follows the default processor setting
Browse files Browse the repository at this point in the history
  • Loading branch information
joethei committed Apr 28, 2022
1 parent 1e64235 commit 307c39c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-plantuml",
"name": "PlantUML",
"version": "1.6.1",
"version": "1.6.2",
"minAppVersion": "0.13.0",
"description": "Render PlantUML Diagrams",
"author": "Johannes Theiner",
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": "obsidian-plantuml",
"version": "1.6.1",
"version": "1.6.2",
"description": "PlantUML rendering for Obsidian.md",
"main": "main.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions src/decorations/EmbedDecoration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ class StatefulDecorationSet {
if(!file) return;
const fileContent = await this.plugin.app.vault.read(file);
const div = createDiv();
await this.plugin.getProcessor().png(fileContent, div, null);
if(this.plugin.settings.defaultProcessor === "png") {
await this.plugin.getProcessor().png(fileContent, div, null);
}else {
await this.plugin.getProcessor().svg(fileContent, div, null);
}
deco = this.decoCache[token.value] = Decoration.replace({widget: new EmojiWidget(div), block: true});
}
decorations.push(deco.range(token.from, token.from));
Expand Down Expand Up @@ -133,7 +137,7 @@ class EmojiWidget extends WidgetType {

constructor(source: HTMLDivElement) {
super();
this.source = source.cloneNode(true) as HTMLDivElement;
this.source = source;
}

eq(other: EmojiWidget) {
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"1.5.2": "0.13.0",
"1.5.3": "0.13.0",
"1.6.0": "0.13.0",
"1.6.1": "0.13.0"
"1.6.1": "0.13.0",
"1.6.2": "0.13.0"
}

0 comments on commit 307c39c

Please sign in to comment.