Skip to content

Commit

Permalink
Merge pull request #227 from TriliumNext/feature/client_updates
Browse files Browse the repository at this point in the history
Update client dependencies, Canvas: "Copy image reference to clipboard" no longer working
  • Loading branch information
eliandoran committed Jul 16, 2024
2 parents 66108c1 + 1eefa65 commit 2dbe3c6
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 54 deletions.
88 changes: 44 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"@braintree/sanitize-url": "6.0.4",
"@electron/remote": "2.1.2",
"@excalidraw/excalidraw": "0.17.3",
"@excalidraw/excalidraw": "^0.17.6",
"archiver": "7.0.0",
"async-mutex": "0.4.1",
"axios": "1.6.7",
Expand Down Expand Up @@ -75,9 +75,9 @@
"jquery": "3.7.1",
"jquery-hotkeys": "0.2.2",
"jsdom": "24.0.0",
"katex": "0.16.9",
"katex": "^0.16.11",
"marked": "12.0.0",
"mermaid": "10.9.0",
"mermaid": "^10.9.1",
"mime-types": "2.1.35",
"multer": "1.4.5-lts.1",
"node-abi": "3.56.0",
Expand All @@ -86,8 +86,8 @@
"panzoom": "9.4.3",
"print-this": "2.0.0",
"rand-token": "1.0.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"request": "2.88.2",
"rimraf": "5.0.5",
"safe-compare": "1.1.4",
Expand Down
9 changes: 4 additions & 5 deletions src/routes/api/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,21 @@ function returnImageInt(image: BNote | BRevision | null, res: Response) {
}

function renderSvgAttachment(image: BNote | BRevision, res: Response, attachmentName: string) {
let svgString = '<svg/>'
let svg: string | Buffer = '<svg/>'
const attachment = image.getAttachmentByTitle(attachmentName);

const content = attachment.getContent();
if (attachment && typeof content === "string") {
svgString = content;
if (attachment) {
svg = content;
} else {
// backwards compatibility, before attachments, the SVG was stored in the main note content as a separate key
const contentSvg = image.getJsonContentSafely()?.svg;

if (contentSvg) {
svgString = contentSvg;
svg = contentSvg;
}
}

const svg = svgString
res.set('Content-Type', "image/svg+xml");
res.set("Cache-Control", "no-cache, no-store, must-revalidate");
res.send(svg);
Expand Down

0 comments on commit 2dbe3c6

Please sign in to comment.