nodebb-plugin-markdown 9.0.9 → 9.0.10
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/index.js +6 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -220,12 +220,10 @@ const Markdown = {
|
|
|
220
220
|
if (size) {
|
|
221
221
|
env.images.set(filename, size);
|
|
222
222
|
} else {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
});
|
|
228
|
-
|
|
223
|
+
// Size checked asynchronously, see: https://github.com/tomas/needle/issues/389
|
|
224
|
+
probe(match, {
|
|
225
|
+
follow_max: 2,
|
|
226
|
+
}).then((size) => {
|
|
229
227
|
let { width, height } = size;
|
|
230
228
|
|
|
231
229
|
// Swap width and height if orientation bit is set
|
|
@@ -235,10 +233,10 @@ const Markdown = {
|
|
|
235
233
|
|
|
236
234
|
env.images.set(filename, { width, height });
|
|
237
235
|
Markdown._externalImageCache.set(match, { width, height });
|
|
238
|
-
}
|
|
236
|
+
}).catch(() => {
|
|
239
237
|
// Likely an issue getting the external image size, ignore in the future
|
|
240
238
|
Markdown._externalImageFailures.add(match);
|
|
241
|
-
}
|
|
239
|
+
});
|
|
242
240
|
}
|
|
243
241
|
}
|
|
244
242
|
}
|