File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,14 @@ export default class MarkdownPlugin extends AdminForthPlugin {
162162 return u . pathname . replace ( / ^ \/ + / , '' ) ;
163163 } catch {
164164 // Fallback: strip scheme/host if it looks like a URL, otherwise treat as a path.
165- return stripQueryAndHash ( url ) . replace ( / ^ h t t p s ? : \/ \/ [ ^ \/ ] + \/ + / , '' ) . replace ( / ^ \/ + / , '' ) ;
165+ const key = stripQueryAndHash ( url ) . replace ( / ^ h t t p s ? : \/ \/ [ ^ \/ ] + \/ + / , '' ) . replace ( / ^ \/ + / , '' ) ;
166+
167+ // since only local storage adapter returns non-URL paths
168+ // we need to cut-off express-base
169+ // e.g. /uploaded-static/cars_description_images-74bbe25a154500c4a2fcb91fb91cea75/sqlite/images_1775114133312.webp
170+ // should become /sqlite/images_1775114133312.webp
171+ const cutted = key . split ( "/" ) . filter ( Boolean ) . slice ( 2 ) . join ( "/" ) ;
172+ return cutted ;
166173 }
167174 } ;
168175
You can’t perform that action at this time.
0 commit comments