Add image cbs
This commit is contained in:
@@ -242,4 +242,12 @@ html, body{
|
|||||||
background-color: var(--tw-prose-pre-bg);
|
background-color: var(--tw-prose-pre-bg);
|
||||||
padding: 0.125rem 0.25rem;
|
padding: 0.125rem 0.25rem;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.x-risu-risu-inlay-image{
|
||||||
|
@apply w-full flex justify-center
|
||||||
|
}
|
||||||
|
|
||||||
|
.x-risu-risu-inlay-image > img{
|
||||||
|
@apply rounded-lg focus:outline-none max-w-80 w-full
|
||||||
}
|
}
|
||||||
@@ -250,7 +250,7 @@ async function renderHighlightableMarkdown(data:string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const assetRegex = /{{(raw|img|video|audio|bg|emotion|asset|video-img|source)::(.+?)}}/g
|
export const assetRegex = /{{(raw|img|image|video|audio|bg|emotion|asset|video-img|source)::(.+?)}}/g
|
||||||
|
|
||||||
async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|character, mode:'normal'|'back', mode2:'unset'|'pre'|'post' = 'unset'){
|
async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|character, mode:'normal'|'back', mode2:'unset'|'pre'|'post' = 'unset'){
|
||||||
const db = get(DataBase)
|
const db = get(DataBase)
|
||||||
@@ -322,6 +322,8 @@ async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|c
|
|||||||
return path.path
|
return path.path
|
||||||
case 'img':
|
case 'img':
|
||||||
return `<img src="${path.path}" alt="${path.path}" style="${assetWidthString} "/>`
|
return `<img src="${path.path}" alt="${path.path}" style="${assetWidthString} "/>`
|
||||||
|
case 'image':
|
||||||
|
return `<div class="risu-inlay-image"><img src="${path.path}" alt="${path.path}" style="${assetWidthString}"/></div>`
|
||||||
case 'video':
|
case 'video':
|
||||||
return `<video controls autoplay loop><source src="${path.path}" type="video/mp4"></video>`
|
return `<video controls autoplay loop><source src="${path.path}" type="video/mp4"></video>`
|
||||||
case 'video-img':
|
case 'video-img':
|
||||||
|
|||||||
Reference in New Issue
Block a user