mirror of
https://github.com/zadam/trilium.git
synced 2025-11-24 01:58:50 +08:00
fix(mermaid): bring back export as SVG
This commit is contained in:
parent
1fb2b5341d
commit
c416fca88a
1 changed files with 10 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
|
import type { EventData } from "../../components/app_context.js";
|
||||||
import type FNote from "../../entities/fnote.js";
|
import type FNote from "../../entities/fnote.js";
|
||||||
import server from "../../services/server.js";
|
import server from "../../services/server.js";
|
||||||
|
import utils from "../../services/utils.js";
|
||||||
import AbstractSplitTypeWidget from "./abstract_split_type_widget.js";
|
import AbstractSplitTypeWidget from "./abstract_split_type_widget.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -159,4 +161,12 @@ export default abstract class AbstractSvgSplitTypeWidget extends AbstractSplitTy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async exportSvgEvent({ ntxId }: EventData<"exportSvg">) {
|
||||||
|
if (!this.isNoteContext(ntxId) || this.note?.type !== "mermaid" || !this.svg) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
utils.downloadSvg(this.note.title, this.svg);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue