Skip to content

Commit

Permalink
🐛 Fix: urlEncode bug when copy
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #731
  • Loading branch information
Molunerfinn committed Aug 23, 2021
1 parent a676c08 commit 6c6f847
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/universal/utils/pasteTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { IPasteStyle } from '#/types/enum'
import { handleUrlEncode } from './common'

const formatCustomLink = (customLink: string, item: ImgInfo) => {
let fileName = item.fileName!.replace(new RegExp(`\\${item.extname}$`), '')
const url = handleUrlEncode(item.url || item.imgUrl)
const url = item.url || item.imgUrl
const formatObj = {
url,
fileName
Expand All @@ -19,7 +18,7 @@ const formatCustomLink = (customLink: string, item: ImgInfo) => {
}

export default (style: IPasteStyle, item: ImgInfo, customLink: string | undefined) => {
const url = handleUrlEncode(item.url || item.imgUrl)
const url = item.url || item.imgUrl
const _customLink = customLink || '$url'
const tpl = {
'markdown': `![](${url})`,
Expand Down

0 comments on commit 6c6f847

Please sign in to comment.