@@ -12,7 +12,7 @@ import {getColIconByType, getColId} from "./col";
1212import { genAVValueHTML , getAVTemplateHTML } from "./attributeValue" ;
1313import { Constants } from "../../../constants" ;
1414import { hintRef } from "../../hint/extend" ;
15- import { getAssetName , pathPosix } from "../../../util/pathName" ;
15+ import { getAssetExtension , getAssetName } from "../../../util/pathName" ;
1616import { mergeAddOption } from "./select" ;
1717import { escapeAriaLabel , escapeAttr , escapeHtml } from "../../../util/escape" ;
1818import { electronUndo } from "../../undo" ;
@@ -230,7 +230,7 @@ const transformCellValue = (colType: TAVCol, value: IAVCellValue): IAVCellValue
230230 } else if ( colType === "mAsset" ) {
231231 const content = getCellValueContent ( value ) . toString ( ) ;
232232 newValue . mAsset = [ {
233- type : Constants . SIYUAN_ASSETS_IMAGE . includes ( pathPosix ( ) . extname ( content ) . toLowerCase ( ) ) ? "image" : "file" ,
233+ type : Constants . SIYUAN_ASSETS_IMAGE . includes ( getAssetExtension ( content ) . toLowerCase ( ) ) ? "image" : "file" ,
234234 content,
235235 name : "" ,
236236 } ] ;
@@ -302,7 +302,7 @@ export const genCellValue = (colType: TAVCol, value: string | any, dateFormat: T
302302 relation : { blockIDs : [ value ] , contents : [ ] }
303303 } ;
304304 } else if ( colType === "mAsset" ) {
305- const type = pathPosix ( ) . extname ( value ) . toLowerCase ( ) ;
305+ const type = getAssetExtension ( value ) . toLowerCase ( ) ;
306306 cellValue = {
307307 type : colType ,
308308 mAsset : [ {
@@ -842,7 +842,7 @@ export const updateCellsValue = async (protyle: IProtyle, nodeElement: HTMLEleme
842842 // https://github.com/siyuan-note/siyuan/issues/13892
843843 if ( ! link && value . startsWith ( "assets/" ) ) {
844844 link = value ;
845- name = getAssetName ( value ) + pathPosix ( ) . extname ( value ) ;
845+ name = getAssetName ( value ) + getAssetExtension ( value ) ;
846846 }
847847 // https://github.com/siyuan-note/siyuan/issues/12308
848848 if ( html ) {
0 commit comments