This commit is contained in:
Vanessa 2022-08-18 23:47:22 +08:00
parent c29b2404ea
commit 17a8d4fac2
4 changed files with 12 additions and 9 deletions

View file

@ -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}">`;