nodebb-plugin-mentions 4.7.3 → 4.7.5

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.
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ import serverConfig from 'eslint-config-nodebb';
4
+ import publicConfig from 'eslint-config-nodebb/public';
5
+
6
+ export default [
7
+ ...publicConfig,
8
+ ...serverConfig,
9
+ ];
10
+
package/library.js CHANGED
@@ -473,7 +473,7 @@ Mentions.parseRaw = async (content, type = 'default') => {
473
473
  // Again, cleaning up lookaround leftover bits
474
474
  const atIndex = match.indexOf('@');
475
475
  const plain = match.slice(0, atIndex);
476
- match = match.slice(atIndex);
476
+ match = match.slice(atIndex + 1);
477
477
  if (user && user.uid) {
478
478
  switch (Mentions._settings.display) {
479
479
  case 'fullname':
@@ -489,7 +489,7 @@ Mentions.parseRaw = async (content, type = 'default') => {
489
489
  if (type === 'markdown') {
490
490
  str = `[${match}](${nconf.get('url')}${url})`;
491
491
  } else {
492
- str = `<a class="plugin-mentions-${mentionType} plugin-mentions-a" href="${url}">@<bdi>${match.slice(1)}</bdi></a>`;
492
+ str = `<a class="plugin-mentions-${mentionType} plugin-mentions-a" href="${nconf.get('relative_path')}${url}">${!Mentions._settings.display ? '@' : ''}<bdi>${match}</bdi></a>`;
493
493
  }
494
494
 
495
495
  return plain + str;