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.
Files changed (2) hide show
  1. package/index.js +6 -8
  2. 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
- try {
224
- // eslint-disable-next-line no-await-in-loop
225
- const size = await probe(match, {
226
- follow_max: 2,
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
- } catch (e) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-markdown",
3
- "version": "9.0.9",
3
+ "version": "9.0.10",
4
4
  "description": "A Markdown parser for NodeBB",
5
5
  "main": "index.js",
6
6
  "repository": {