mirror of https://github.com/status-im/codimd.git
Use array for tags when available (close #1496)
Signed-off-by: Daniele Ricci <daniele@casaricci.it>
This commit is contained in:
parent
4fd6293963
commit
5463c8412c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue