mirror of
https://github.com/status-im/codimd.git
synced 2025-02-17 02:16:45 +00:00
Merge pull request #1505 from daniele-athome/pr/feature/tags-array
Use array for tags when available (close #1496)
This commit is contained in:
commit
3e09c7a21f
@ -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…
x
Reference in New Issue
Block a user