@adminforth/markdown 1.11.0 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.log +1 -1
- package/dist/index.js +7 -1
- package/index.ts +8 -1
- package/package.json +1 -1
package/build.log
CHANGED
package/dist/index.js
CHANGED
|
@@ -158,7 +158,13 @@ export default class MarkdownPlugin extends AdminForthPlugin {
|
|
|
158
158
|
}
|
|
159
159
|
catch (_a) {
|
|
160
160
|
// Fallback: strip scheme/host if it looks like a URL, otherwise treat as a path.
|
|
161
|
-
|
|
161
|
+
const key = stripQueryAndHash(url).replace(/^https?:\/\/[^\/]+\/+/, '').replace(/^\/+/, '');
|
|
162
|
+
// since only local storage adapter returns non-URL paths
|
|
163
|
+
// we need to cut-off express-base
|
|
164
|
+
// e.g. /uploaded-static/cars_description_images-74bbe25a154500c4a2fcb91fb91cea75/sqlite/images_1775114133312.webp
|
|
165
|
+
// should become /sqlite/images_1775114133312.webp
|
|
166
|
+
const cutted = key.split("/").filter(Boolean).slice(2).join("/");
|
|
167
|
+
return cutted;
|
|
162
168
|
}
|
|
163
169
|
};
|
|
164
170
|
const shouldTrackUrl = (url) => {
|
package/index.ts
CHANGED
|
@@ -170,7 +170,14 @@ export default class MarkdownPlugin extends AdminForthPlugin {
|
|
|
170
170
|
return u.pathname.replace(/^\/+/, '');
|
|
171
171
|
} catch {
|
|
172
172
|
// Fallback: strip scheme/host if it looks like a URL, otherwise treat as a path.
|
|
173
|
-
|
|
173
|
+
const key = stripQueryAndHash(url).replace(/^https?:\/\/[^\/]+\/+/, '').replace(/^\/+/, '');
|
|
174
|
+
|
|
175
|
+
// since only local storage adapter returns non-URL paths
|
|
176
|
+
// we need to cut-off express-base
|
|
177
|
+
// e.g. /uploaded-static/cars_description_images-74bbe25a154500c4a2fcb91fb91cea75/sqlite/images_1775114133312.webp
|
|
178
|
+
// should become /sqlite/images_1775114133312.webp
|
|
179
|
+
const cutted = key.split("/").filter(Boolean).slice(2).join("/");
|
|
180
|
+
return cutted;
|
|
174
181
|
}
|
|
175
182
|
};
|
|
176
183
|
|