@@ -26,11 +26,11 @@ export const detectLink = (params: { lineText: string; sourceFile: TFile; plugin
2626
2727 // --> A. Internal Image Links
2828 // 1. [[ ]] format
29- const internalImageWikiRegex = / ! \[ \[ .* ?( j p e ? g | p n g | g i f | s v g | b m p ) .* ?\] \] / ;
29+ const internalImageWikiRegex = / ! \[ \[ .* ?( j p e ? g | p n g | g i f | s v g | b m p | w e b p ) .* ?\] \] / ;
3030 const internalImageWikiMatch = lineText . match ( internalImageWikiRegex ) ;
3131
3232 if ( internalImageWikiMatch ) {
33- const fileNameRegex = / \[ \[ .* ( j p e ? g | p n g | g i f | s v g | b m p ) / ;
33+ const fileNameRegex = / \[ \[ .* ( j p e ? g | p n g | g i f | s v g | b m p | w e b p ) / ;
3434 const fileMatch = internalImageWikiMatch [ 0 ] . match ( fileNameRegex ) ;
3535 if ( fileMatch ) {
3636 const fileMatchClear = fileMatch [ 0 ] . replace ( '[[' , '' ) ;
@@ -136,11 +136,11 @@ export const detectLink = (params: { lineText: string; sourceFile: TFile; plugin
136136 }
137137
138138 // 2.  format
139- const internalImageMdRegex = / ! \[ ( ^ $ | .* ?) \] \( .* ?( j p e ? g | p n g | g i f | s v g | b m p ) \) / ;
139+ const internalImageMdRegex = / ! \[ ( ^ $ | .* ?) \] \( .* ?( j p e ? g | p n g | g i f | s v g | b m p | w e b p ) \) / ;
140140 const internalImageMdMatch = lineText . match ( internalImageMdRegex ) ;
141141
142142 if ( internalImageMdMatch ) {
143- const fileNameRegex = / \( .* ( j p e ? g | p n g | g i f | s v g | b m p ) / ;
143+ const fileNameRegex = / \( .* ( j p e ? g | p n g | g i f | s v g | b m p | w e b p ) / ;
144144 const fileMatch = internalImageMdMatch [ 0 ] . match ( fileNameRegex ) ;
145145 if ( fileMatch ) {
146146 const fileMatchClear = fileMatch [ 0 ] . replace ( '(' , '' ) ;
@@ -322,8 +322,8 @@ export const detectLink = (params: { lineText: string; sourceFile: TFile; plugin
322322 */
323323
324324 // --> G: Local File Markdown
325- const localFileMdRegex = / ! \[ ( ^ $ | .* ) \] \( ( f i l e \: \/ \/ \/ | a p p \: \/ \/ l o c a l \/ ) .* ( .p d f | .j p e ? g | .p n g | .g i f | .s v g | .b m p ) ( .* ) ? \) / ;
326- const localFileNameRegex = / ( f i l e \: \/ \/ \/ | a p p \: \/ \/ l o c a l \/ ) .* ( .p d f | .j p e ? g | .p n g | .g i f | .s v g | .b m p ) / ;
325+ const localFileMdRegex = / ! \[ ( ^ $ | .* ) \] \( ( f i l e \: \/ \/ \/ | a p p \: \/ \/ l o c a l \/ ) .* ( .p d f | .j p e ? g | .p n g | .g i f | .s v g | .b m p | . w e b p ) ( .* ) ? \) / ;
326+ const localFileNameRegex = / ( f i l e \: \/ \/ \/ | a p p \: \/ \/ l o c a l \/ ) .* ( .p d f | .j p e ? g | .p n g | .g i f | .s v g | .b m p | . w e b p ) / ;
327327 const localFileMatchMd = lineText . match ( localFileMdRegex ) ;
328328
329329 if ( localFileMatchMd ) {
0 commit comments