nodebb-plugin-mentions 4.6.3 → 4.6.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.
- package/library.js +2 -2
- package/package.json +1 -1
- package/static/autofill.js +1 -1
package/library.js
CHANGED
|
@@ -113,7 +113,7 @@ Mentions.notify = async function ({ post }) {
|
|
|
113
113
|
|
|
114
114
|
if (Array.isArray(tag) && tag.length) {
|
|
115
115
|
const slugs = tag.reduce((slugs, tag) => {
|
|
116
|
-
if (tag.type === 'Mention') {
|
|
116
|
+
if (tag.type === 'Mention' && tag.name && typeof tag.name === 'string') {
|
|
117
117
|
const [slug, hostname] = tag.name.slice(1).split('@');
|
|
118
118
|
if (hostname === nconf.get('url_parsed').hostname) {
|
|
119
119
|
slugs.push(slug);
|
|
@@ -416,7 +416,7 @@ Mentions.parseRaw = async (content, type = 'default') => {
|
|
|
416
416
|
}
|
|
417
417
|
|
|
418
418
|
// Note: Mentions.clean explicitly can't be called here because I need the content unstripped
|
|
419
|
-
let { splitContent, matches, urlMap } = await getMatches(content);
|
|
419
|
+
let { splitContent, matches, urlMap } = await getMatches(content, true);
|
|
420
420
|
|
|
421
421
|
if (!matches.length && !urlMap.size) {
|
|
422
422
|
return content;
|
package/package.json
CHANGED
package/static/autofill.js
CHANGED
|
@@ -43,7 +43,7 @@ $(document).ready(function () {
|
|
|
43
43
|
const localMatches = localUserList.filter(
|
|
44
44
|
u => u.username.toLocaleLowerCase().startsWith(termLowerCase)
|
|
45
45
|
);
|
|
46
|
-
const categoryMatches = categoryList.filter(c => c.handle.startsWith(termLowerCase));
|
|
46
|
+
const categoryMatches = categoryList.filter(c => c && c.handle && c.handle.startsWith(termLowerCase));
|
|
47
47
|
|
|
48
48
|
// remove local matches from search results, add category matches
|
|
49
49
|
users = users.filter(u => !localMatches.find(lu => lu.uid === u.uid));
|