mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-11 06:38:13 -05:00
14 lines
347 B
JavaScript
14 lines
347 B
JavaScript
import db from '../../datastore'
|
|
|
|
export default (style, url) => {
|
|
const customLink = db.read().get('settings.customLink').value() || '$url'
|
|
const tpl = {
|
|
'markdown': `![](${url})`,
|
|
'HTML': `<img src="${url}"/>`,
|
|
'URL': url,
|
|
'UBB': `[IMG]${url}[/IMG]`,
|
|
'Custom': customLink.replace(/\$url/g, url)
|
|
}
|
|
return tpl[style]
|
|
}
|