nodebb-plugin-link-preview 1.0.5 → 1.0.6

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/library.js +7 -4
  2. package/package.json +1 -1
package/library.js CHANGED
@@ -1,3 +1,5 @@
1
+ /* eslint-disable no-continue */
2
+
1
3
  'use strict';
2
4
 
3
5
  const winston = require.main.require('winston');
@@ -51,15 +53,16 @@ async function process(content, opts) {
51
53
  const url = $anchor.attr('href');
52
54
 
53
55
  if ($anchor.hasClass('plugin-mentions-a')) {
54
- // eslint-disable-next-line no-continue
55
56
  continue;
56
57
  }
57
58
 
58
59
  const cached = cache.get(`link-preview:${url}`);
59
60
  if (cached) {
60
- // eslint-disable-next-line no-await-in-loop
61
- $anchor.replaceWith($(await render(cached)));
62
- break;
61
+ if (cached.contentType) {
62
+ // eslint-disable-next-line no-await-in-loop
63
+ $anchor.replaceWith($(await render(cached)));
64
+ }
65
+ continue;
63
66
  }
64
67
 
65
68
  // Generate the preview, but return false for now so as to not block response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-link-preview",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "A starter kit for quickly creating NodeBB plugins",
5
5
  "main": "library.js",
6
6
  "repository": {