Skip to content

Commit

Permalink
fix: export as svg on Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
vipzhicheng committed Jun 21, 2024
1 parent 884dbc2 commit 48cb1a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.4.5

- fix: export as svg on Firefox

## 0.4.4

- fix: pdf area annotation render issue.
Expand Down
8 changes: 5 additions & 3 deletions src/funcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function eventFire(el: any, etype: string) {
}

export const getSVGContent = (svg: SVGElement): string => {
const xmlVersion = '1.1'
const xmlVersion = '1.0'
const svgVersion = '1.1'
const svgBaseProfile = 'full'
const svgXmlns = 'http://www.w3.org/2000/svg'
Expand All @@ -78,7 +78,7 @@ export const getSVGContent = (svg: SVGElement): string => {
.replace(/assets:\/\//g, '')
.replace(/<img([^<]*?)>/g, '<img$1/>')

let svgContent = `<?xml version="${xmlVersion}"?>
let svgContent = `<?xml version="${xmlVersion}" encoding="UTF-8" standalone="no"?>
<svg version="${svgVersion}"
baseProfile="${svgBaseProfile}"
width="${viewportWidth}"
Expand Down Expand Up @@ -781,7 +781,9 @@ export const hookMarkmapTransformer = async (transformer: Transformer) => {
const maxSize = logseq.settings?.maxRenderImageSize
? logseq.settings.maxRenderImageSize
: '100'
const minSize = 20
const minSize = logseq.settings?.minRenderImageSize
? logseq.settings.minRenderImageSize
: '50'
result = `<a target="_blank" title="${alt}" data-lightbox="gallery" href="${
src.indexOf('http') !== 0 ? 'assets://' : ''
}${src}"><img alt="${alt}" src="${
Expand Down

0 comments on commit 48cb1a8

Please sign in to comment.