mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-26 17:04:07 +01:00
🚨
This commit is contained in:
parent
c29b2404ea
commit
17a8d4fac2
4 changed files with 12 additions and 9 deletions
|
|
@ -2,6 +2,9 @@ import {Constants} from "../constants";
|
|||
import {pathPosix} from "../util/pathName";
|
||||
|
||||
export const renderAssetsPreview = (pathString: string) => {
|
||||
if (!pathString) {
|
||||
return "";
|
||||
}
|
||||
const type = pathPosix().extname(pathString).toLowerCase();
|
||||
if (Constants.SIYUAN_ASSETS_IMAGE.includes(type)) {
|
||||
return `<img style="max-height: 100%" src="${pathString}">`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue