diff --git a/.eslintrc.js b/.eslintrc.js index 177e9b5..d9a13a7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,6 +11,7 @@ module.exports = { '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-unused-vars': 'off', }, // https://eslint.org/docs/rules/no-undef#nodejs env: { diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bdaf7f..fcbb5da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.4.4 - fix: pdf area annotation render issue. +- fix: export as svg do not support image. - chore: upgrade deps ## 0.4.3 diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index 71aaec7..efcfa70 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -73,7 +73,7 @@ const handleSavePNG = async () => { const page = await logseq.Editor.getCurrentPage() if (el) { html2canvas(el, {}).then(async function (canvas: HTMLCanvasElement) { - const title = page?.originalName + const title = page?.originalName as string const url = canvas.toDataURL('image/png') const oA = document.createElement('a') oA.download = title || '' diff --git a/src/funcs.ts b/src/funcs.ts index cd67ad1..3cbd884 100644 --- a/src/funcs.ts +++ b/src/funcs.ts @@ -11,7 +11,6 @@ import org from 'org' import replaceAsync from 'string-replace-async' import ellipsis from 'text-ellipsis' import TurndownService from 'turndown' -import { l } from 'vite/dist/node/types.d-aGj9QkWt' const settingsVersion = 'v3' export const defaultSettings = { @@ -76,6 +75,8 @@ export const getSVGContent = (svg: SVGElement): string => { svgInner = svgInner .replace(/onclick=".*?"/g, '') .replace(/.*?<\/a>/g, '') + .replace(/assets:\/\//g, '') + .replace(//g, '') let svgContent = ` ` + }${filePath}" style="max-height: ${maxSize}px; min-width: ${minSize}px;"/>` } else { result = `