mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-02 11:08:13 -05:00
parent
a676c083fe
commit
6c6f84779a
@ -1,9 +1,8 @@
|
|||||||
import { IPasteStyle } from '#/types/enum'
|
import { IPasteStyle } from '#/types/enum'
|
||||||
import { handleUrlEncode } from './common'
|
|
||||||
|
|
||||||
const formatCustomLink = (customLink: string, item: ImgInfo) => {
|
const formatCustomLink = (customLink: string, item: ImgInfo) => {
|
||||||
let fileName = item.fileName!.replace(new RegExp(`\\${item.extname}$`), '')
|
let fileName = item.fileName!.replace(new RegExp(`\\${item.extname}$`), '')
|
||||||
const url = handleUrlEncode(item.url || item.imgUrl)
|
const url = item.url || item.imgUrl
|
||||||
const formatObj = {
|
const formatObj = {
|
||||||
url,
|
url,
|
||||||
fileName
|
fileName
|
||||||
@ -19,7 +18,7 @@ const formatCustomLink = (customLink: string, item: ImgInfo) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default (style: IPasteStyle, item: ImgInfo, customLink: string | undefined) => {
|
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 _customLink = customLink || '$url'
|
||||||
const tpl = {
|
const tpl = {
|
||||||
'markdown': `![](${url})`,
|
'markdown': `![](${url})`,
|
||||||
|
Loading…
Reference in New Issue
Block a user