diff --git a/lib/models/note.js b/lib/models/note.js index 8030be00..d7109d44 100644 --- a/lib/models/note.js +++ b/lib/models/note.js @@ -367,8 +367,13 @@ module.exports = function (sequelize, DataTypes) { Note.extractNoteTags = function (meta, $) { var tags = [] var rawtags = [] + var metaTags if (meta.tags && (typeof meta.tags === 'string' || typeof meta.tags === 'number')) { - var metaTags = ('' + meta.tags).split(',') + metaTags = ('' + meta.tags).split(',') + } else if (meta.tags && (Array.isArray(meta.tags))) { + metaTags = meta.tags + } + if (metaTags) { for (let i = 0; i < metaTags.length; i++) { var text = metaTags[i].trim() if (text) rawtags.push(text)