Add gemini image response
This commit is contained in:
@@ -495,14 +495,14 @@ function trimmer(str:string){
|
||||
}
|
||||
|
||||
async function parseInlayAssets(data:string){
|
||||
const inlayMatch = data.match(/{{(inlay|inlayed)::(.+?)}}/g)
|
||||
const inlayMatch = data.match(/{{(inlay|inlayed|inlayeddata)::(.+?)}}/g)
|
||||
if(inlayMatch){
|
||||
for(const inlay of inlayMatch){
|
||||
const inlayType = inlay.startsWith('{{inlayed') ? 'inlayed' : 'inlay'
|
||||
const id = inlay.substring(inlay.indexOf('::') + 2, inlay.length - 2)
|
||||
const asset = await getInlayAsset(id)
|
||||
let prefix = inlayType === 'inlayed' ? `<div class="risu-inlay-image">` : ''
|
||||
let postfix = inlayType === 'inlayed' ? `</div>\n\n` : ''
|
||||
let prefix = inlayType !== 'inlay' ? `<div class="risu-inlay-image">` : ''
|
||||
let postfix = inlayType !== 'inlay' ? `</div>\n\n` : ''
|
||||
switch(asset?.type){
|
||||
case 'image':
|
||||
data = data.replace(inlay, `${prefix}<img src="${asset.data}"/>${postfix}`)
|
||||
|
||||
Reference in New Issue
Block a user