Skip to content

Commit 5463c84

Browse files
Use array for tags when available (close #1496)
Signed-off-by: Daniele Ricci <[email protected]>
1 parent 4fd6293 commit 5463c84

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/models/note.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,13 @@ module.exports = function (sequelize, DataTypes) {
367367
Note.extractNoteTags = function (meta, $) {
368368
var tags = []
369369
var rawtags = []
370+
var metaTags
370371
if (meta.tags && (typeof meta.tags === 'string' || typeof meta.tags === 'number')) {
371-
var metaTags = ('' + meta.tags).split(',')
372+
metaTags = ('' + meta.tags).split(',')
373+
} else if (meta.tags && (Array.isArray(meta.tags))) {
374+
metaTags = meta.tags
375+
}
376+
if (metaTags) {
372377
for (let i = 0; i < metaTags.length; i++) {
373378
var text = metaTags[i].trim()
374379
if (text) rawtags.push(text)

0 commit comments

Comments
 (0)