twemojiをセルフホストに変更
This commit is contained in:
parent
836073ecb8
commit
e7bdc89980
1 changed files with 10 additions and 2 deletions
|
@ -20,7 +20,15 @@ function parser(fm_text:string) {
|
|||
let index = 'index' in fm && typeof fm.index === 'boolean' ? fm.index : true
|
||||
let published = 'published' in fm && typeof fm.published === 'boolean' ? fm.published : false
|
||||
|
||||
emoji = parse(emoji)[0]?.url ?? ''
|
||||
emoji = parse(emoji, {buildUrl: builder})[0]?.url ?? ''
|
||||
|
||||
function builder(codepoints: string, assetType: string): string {
|
||||
if (assetType == "png") {
|
||||
return `https://moris.day/twemoji/72x72/${codepoints}.png`
|
||||
} else {
|
||||
return `https://moris.day/twemoji/svg/${codepoints}.svg`
|
||||
}
|
||||
}
|
||||
|
||||
let date:Date = new Date(date_str)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue